常见问题
速查;专题见目录各章。
Redux 和 Context? Redux 强约束、DevTools、中间件;Context 适合低频配置。
为何要 action? 可预测、可记录;改 state 只能经 reducer。
异步怎么做? thunk / saga / RTK Query,不在 reducer 里 await。
为何 subscribe 无参? 设计选择;自调 getState()。见 08。
和 Zustand? Redux 更重、生态大;Zustand 更轻。见 对比。
还要手写 Redux 吗? 新项目优先 RTK;理解 core 仍看本系列 02–06。
多 store? 不推荐;用 combineReducers。
性能? reselect、细 selector、不变数据引用。
读源码:createStore → combineReducers → applyMiddleware。