Leveraging (algebraic data) types to make your UI rock solid
summary
Shows concrete TypeScript patterns and a small library that replace nulls, exceptions and ad‑hoc loading flags with explicit sum types so UI states become unambiguous. Uses an array/find smartwatch example to show nested Option/Maybe cases, maps errors into a Result/Either value so failures are part of the type, and models fetch lifecycle as a single AsyncData union to eliminate impossible state combinations. Includes a demo loading a random person and a GitHub repo to try.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:17State management challenges
- 4:45Managing presence with options
- 9:45Handling success and errors
- 13:56Managing application completion
- 17:13Algebraic data types in practice
- 20:35Tools and library resources
- 23:15Conclusion
related talks
25mLeveraging (algebraic data) types to make your UI rock solid
30mSwipe Left, Uncaught TypeError Learning to Love Type Systems
01h 01mAdvanced TypeScript Type Utilities
34mNot Your Uncle’s Clean Code (TypeScript Edition)
44mA Deep Dive Into Advanced Typescript: A Live Coding Expedition
44mA Deep Dive Into Advanced TypeScript - A Live Coding Expedition
40mEnhanced safety with types
40mHow to model your crazy data in TypeScript
