News for hackers. Stuff that matters.
Re:Announcing TypeScript 2.1 by jc79 on Wednesday December 07, 2016 @03:01PM (#13125699)
Well, to me at least the mapped types are the main advantage of this release. Very frequently you start building a record incrementally (so, you can't assign it to an interface where all fields are mandatory), but then at a given stage you will validate that record and copy it to another variable which has the type with all the fields mandatory. Previously you had to define two copies, one with mandatory fields, another with all optional... kind of a bummer, and easy to update one and to forget the other!

Also, this greatly improves the type security of variables which work as keys to objects, without repetition of those keys on the interface and on the string literal.

So yeah, I'm thrilled with these changes

Re:Announcing TypeScript 2.1 by dandare on Thursday December 08, 2016 @01:58AM (#13128866)
I do not understand this concept fully and I wish I could read a more detailed explanation of how this works along with plenty of example code.