basarat / typescript-book

:books: The definitive guide to TypeScript and possibly the best TypeScript book :book:. Free and Open Source 🌹
https://basarat.gitbook.io/typescript/
Other
20.8k stars 2.55k forks source link

Unions Types and User Defined Type Guard #46

Open basarat opened 8 years ago

basarat commented 8 years ago

https://github.com/Microsoft/TypeScript/issues/1007

http://stackoverflow.com/a/34193842/390330

HerringtonDarkholme commented 8 years ago

Looking forward to TypeScript book updated!

I think this pull-request worth mentioning. It refines union/intersection type inference. And it enables user-defined nullable types, which is a pain point not resolved in TS's type system but in others(alas, flow-type).

basarat commented 8 years ago

@HerringtonDarkholme Noted for inclusion :rose: