If you've been writing TypeScript for a while, you've probably seen never in error messages or type definitions and wondered what it actually does. It's not just an obscure edge case — never is one of the most practical tools in the type system once you understand how to use it.
Let's walk through three patterns that'll make your TypeScript safer and your codebase cleaner.
Pattern 1: The Switch Statement That Never Lies
You've been here before. You have a union type representing different states:
type ApiState =






