TypeScript · Real-world situation · Experienced
Modelling a complex workflow with discriminated union state
A checkout flow has many states, and bugs come from invalid combinations of flags like isLoading, hasError and isPaid. How would you redesign the types?
2:00