搞了几天都没完全搞明白redux,所以做下笔记
入门教程推荐一个官方文档:
http://camsong.github.io/redux-in-chinese/index.html
redux主要的思想是
store:一般只有一个,主要用来管理state
action:个人理解是,声明一个函数,向外说明有这个函数的存在
函数实现的逻辑建议写在该文件
type表示要执行的动作,一般再带参数返回

reducer:根据action返回的值更新state

combineReducers 可以实现多个reducer

网友评论