Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
johnfn
· 9y ago · 0 comments
If you use discriminated union types - e.g. give them both a type key which is a unique string, then you don't need type guards as typescript is smart enough to understand that checking the type key does the type discrimination.
Comments
[–]
vanwalj
9y ago
Sure, but you don't always have control over an external module or service, and it still something flow is better at
[–]
johnfn
OP
9y ago
Yeah, that's true. I don't know why you've been downvoted. You have a legitimate answer.