compose
它是一个没有依赖的纯函数
compose(f, g, h)(...arg) => f(g(h(...arg)))
使用实例:
createStore
创建store
使用实例:
combineReducers
将多个reducer的状态合并
使用实例:
bindActionCreators
dispatch(ActionCreator(xxx)) 自动dispatch
使用实例:
applyMiddleware
中间件
applyMiddleware简明对比
|
|
使用实例:
总结
Redux 有五个API,分别是:
- createStore
- combineReducers
- applyMiddleware
- bindActionCreators
- compose
createStore 生成的 store 有四个API,分别是:
- getState
- dispatch
- subscribe
- replaceReducer