在reducer函数接收的第二个参数action就是接下来要干的事情了
在Redux中为了能够查看store中的各个状态,在chrome浏览器需先安装一个redux Devtools这个调试工具
当然安装这个插件...this.handleStoreChange这个方法,保持store上的状态和this.state的同步,否则是会报错的,这个订阅函数放在componentWillMount或者componentDidMount...浏览器里添加redux-devtools,在创建store的createStore()的第二个参数中添加redux-devtools插件的配置,使浏览器支持Redux查看store的各种状态
const...store,在一开始constructor函数或者componentWillMount函数中,调用getState()方法,从而获得了state的数据,最终显示到页面上
而如果想要更改store的数据,...,在redux中,需要在组件内的constructor或者componentWillMount,componentDidMount函数中进行触发subscribe()函数
同时它必须接收一个函数,触发store