The Magic of Discriminated Union Types in TypeScript
Aug 22, 2023 路 5 min read 路 This is a handy Typescript trick! In simple terms, I like to describe this feature as conditional types. This feature allows you to do things like the below ApiResponse type, let the code talk for himself // You can assert the property will have a sp...
Join discussion



