Tag: State Machines
All the articles with the tag "State Machines".
- Featured
Booleans Lie: Modeling State with Discriminated Unions in TypeScript
Three booleans give you eight states when you only meant four. Discriminated unions make the illegal ones unrepresentable — model a value as exactly one of a fixed set of shapes and let TypeScript hold you to it.