Login
Roast topics
Find topics
Find it!
From:
www.aleksandrhovhannisyan.com
(Uncensored)
subscribe
Cleaner Type Predicates with Derived Types | Aleksandr Hovhannisyan
https://www.aleksandrhovhannisyan.com/blog/cleaner-type-predicates-with-derived-types/
links
backlinks
Roast topics
Find topics
Roast it!
In TypeScript, type predicates allow you to narrow down an abstract type to a more concrete type with a simple assertion. Together with derived types, they can greatly reduce repetition in your code.