Make invalid states unrepresentable
Model your domain so the compiler rejects the combinations that should never happen.

Go past annotations. Structural typing, narrowing, generics, and the type-level tools that make invalid states impossible.
Model your domain so the compiler rejects the combinations that should never happen.
Build reusable functions and components that keep type information instead of erasing it.
Apply conditional, mapped, and template literal types where they earn their complexity.
Validate and type the data crossing into your app, so external data stops being an any.
4 modules1h 55m