News for hackers. Stuff that matters.
Re:TypeScript 3.7: The Biggest Features and How to Use Them by _bxg1 on Thursday September 12, 2019 @06:32PM (#20957178)
Definitely. Using Flow, type refinement has been one of my biggest annoyances, because the list of things the type system recognizes as such is hardcoded and can't be extended:

  instanceof
  typeof
  Array.isArray()
  == null
And if you want to refine object types it gets even worse; you have to just check for properties that may or may not be there, which means those properties have to be rigidly distinguishable between object types in a union, etc. etc. Being able to do custom, rich object validation and give it first-class hooks into the type system sounds incredible.

There are no comments on this comment yet.