~/talk

Profunctor Optics for state management

Talkat FrontMania 2018 · 2018-11-16· [react, frontend-architecture]
slides:none on file

A concrete claim: profunctor optics let components map parent state into local views and back without actions or reducers. The demo uses useProfunctorState and pro map to convert Fahrenheit↔Celsius, then a composable todo with per-item inputs, all wired by composing lenses. Implementation targets React hooks, composes, and leverages React.memo for acceptable rendering; library is published but alpha. Performance tradeoffs and simplicity versus Redux boilerplate are shown and verified live.

AI-written summary · about

  1. 0:00Introduction
  2. 1:06What are Pro functor optics and why they seem hard
  3. 3:34Pro functors and state
  4. 5:02State management challenges
  5. 7:13Functors in JavaScript
  6. 9:44Redux and bifunctors
  7. 11:27Pro functors as bifunctors
  8. 12:50Lenses in state
  9. 14:13useProfunctorState for React
  10. 15:40Demo: Fahrenheit to Celsius
  11. 21:29Lens composition
  12. 23:18Contravariance vs covariance
  13. 23:40To-do app with profunctor state
  14. 27:46Profunctor list component
  15. 29:57Nested profunctor inputs
  16. 32:52Performance with React.memo
  17. 35:03Profunctor state benefits
  18. 36:51Origins and contributions
  19. 37:53Call to action
~/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.