~/talk

How to train your useReducer

Talkat reactjsday 2023 · on Friday, 2023-10-27· [react]
name:S. Florio
links:none on file
links:none on file
slides:none on file

Compares a monolithic single-source approach to a distributed pattern by building a web configurator preview, shows the real bug where shared state causes unexpected cross-updates, and implements a concrete solution: a useReducer-based undoable enhancer wrapped via the decorator pattern, plus useCallback to fix double-invocation, TypeScript object reducers with generics and infer for safe actions, automated tests that pass, and a successful deploy; the claim is that useReducer plus small, targeted extensions replaces heavy global stores without breaking performance or team isolation.

AI-written summary · about

  1. 0:00useReducer and state management
  2. 6:50Single source of truth limits
  3. 12:13useReducer as solution
  4. 16:11Fixing reducer duplication with useCallback
  5. 19:00Single responsibility in reducers
  6. 22:57Typed reducers with TypeScript
  7. 29:03Summary
  8. 32:14Q&A
~/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.