Give each UI state one TypeScript shape
Use a discriminated union to make loading, success and failure explicit and exhaustive.
2 min readUse a discriminated union to make loading, success and failure explicit and exhaustive.
2 min readPlace each piece of state near the components that need to coordinate, and derive what you can.
2 min read