· 5 min read
TypeScriptStop juggling isLoading, error, and data as separate fields. Discriminated unions make impossible states unrepresentable in TypeScript.
Read article· 5 min read
2 articles
Stop juggling isLoading, error, and data as separate fields. Discriminated unions make impossible states unrepresentable in TypeScript.
Most useEffect bugs come from porting componentDidMount habits to hooks. Here's the synchronization model that makes effects predictable.