If you’ve used Typescript in any real capacity, you’ve probably run into unions. Either defined in third-party libraries or your own definitions. You can define a union with almost any combination or number of types. They’re pretty simple and general...

Markdown supported · ⌘↵ to post
Abhishek S
Jannik Wempe
Platform Engineering Lead @hashnode | Serverless and Frontend Enthusiast
Nice post. Discriminated unions are a very handy tool to have in your TypeScript toolbelt 👍🏼