Inheriting Interface Properties
Here we have a
Comment that all share an
There are tests in place to ensure that all of the
id values are the same.
0:00 In this exercise, we've got a bunch of duplicated interfaces where they all share this ID property. We've got User, Post, and Comment. We've got a bunch of tests down here to make sure that everything stays as it should be. If I remove title from here, then it's going to yell at me because this Post type is not equal to id:string; title:string; body:string.
0:25 Right from the off, this is like a refactor challenge. Your challenge is to make sure the tests continue to pass while getting rid of some of this duplication here. Ideally, we would find some way that User, Post, and Comment would inherit from an object which contained id:string. That's your challenge.