· 5 min read
TypeScriptGenerics are not academic line noise. Used with a few simple rules they make functions reusable and self-documenting without the pain.
Read article· 5 min read
2 articles
Generics are not academic line noise. Used with a few simple rules they make functions reusable and self-documenting without the pain.
Stop juggling isLoading, error, and data as separate fields. Discriminated unions make impossible states unrepresentable in TypeScript.