为什么要阅读Redux源码?
combineReducers
为什么要在 combination
函数中抛出 reducers 格式错误?
ps:在
combineReducers
中校验的。
reducer
不能返回 undefined
hasChanged
存在的意义是?
bindActionCreators
将action包装成包含dispatch的函数包装dispatch
,用途:在没有 dispatch 的组件内使用 action
createStore使用typeof
判断值为 undefined
的变量
参数验证使用 throw 中断执行,写在变量前面
subscribe
types
interface ActionCreator<A, P extends any[] = any[]> { // ActionCreator<type> || ActionCreator<type, type>
}