Michael Jackson - Composing Behavior in React or Why React Hooks are Awesome
summary
Builds a small workout app and proves hooks are just functions that compose real behaviors instead of abstract ideas The repo shows implemented hooks like usePersistentState that syncs a state value to localStorage, a history-based useUndo that stores a values array plus an index to undo and redo, a useLogger that wraps dispatch with a ref and effect to log actions and resulting state, and a thunk wrapper that lets dispatch accept async function actions All demos run live and the undo redo and logger behaviors work as shown
AI-written summary · about
chapters (10)
- 0:00Start
- 7:01Functions
- 10:16Hooks Are Just Functions
- 12:47New Post Component
- 14:49Persistent State
- 17:53Redo Button
- 19:10Design this Behavior as a Hook
- 24:53Reducer
- 25:14Redux Middleware
- 28:54Asynchronous Actions








