~/talk

Leveraging (algebraic data) types to make your UI rock solid

Talkat JSHeroes 2023 · 2023-05-18..05-19· [typescript, developer-experience]
slides:none on file

Claim: modeling UI state with algebraic data types in TypeScript eliminates classes of bugs by making optionality, fallibility and asynchronicity explicit. Tools actually used: Option/Maybe for nested optionality, Result/Either for typed errors (no exceptions), AsyncData to collapse eight bogus object states into four real variants. Built a demo app plus a swan-io/boxed library and examples; code shrinks, the compiler forces exhaustive handling, and runtime glitches around undefined/promises disappear.

AI-written summary · about

  1. 0:00Algebraic data types intro
  2. 3:13UI state management matters
  3. 5:20Presence with option types
  4. 11:04Success with result types
  5. 16:20Completion with async data
  6. 20:15State management approaches
  7. 22:24Boxed library for TypeScript
  8. 23:50Conclusion and key takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.