fw-01 step 01 — The store, naive on purpose
Goal
Get stages 1–3 of src/spec.mjs green with the simplest implementation that could work. Do not
add guards yet — you need to feel the bugs.
Tasks
createStore(reducer, preloadedState?, enhancer?)—getState,dispatch,subscribe.combineReducers, preserving the state reference when nothing changed. That reference stability is what makes downstream reference-equality checks work.applyMiddleware, composing left to right; write a logger and a thunk-shaped middleware.- Run
node spec.mjs. Stages 1–3 should pass; stage 4 should fail. That failure is the module.
Done when
- Stages 1–3 green
- Stage 4 failing, and you can predict which tests before running
-
You can explain why
combineReducersmust return the same object when nothing changed