Discriminated Unions: The TypeScript Pattern I Reach For Most
Discriminated unions turn impossible states into compile errors. The single TypeScript pattern that has removed the most bugs from my code, with real examples.
JavaScript & TypeScript11 min read