Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
rideg
· 4y ago · 0 comments
You can use type guards for something similar:
https://www.typescriptlang.org/docs/handbook/advanced-types....
Comments
[–]
brundolf
4y ago
What they were getting at is that you can't observe T itself, only values passed in as type T
[–]
323
4y ago
Keyword similar. I use type guards for other things (like typing JSON responses), but they can't solve this particular problem.