为什么使用redux?
共享数据如何使用?
- Import { createStore } from ‘redux’
- createStore(函数)
- dispathch 派发action描述对象的
- getState 获取仓库状态的
- replaceReducer 替换reducer 仓库的
- subscribe 监听仓库状态变化的
- reducer 函数中的state参数接收的状态为上一次该reducer函数的返回结果
redux 三个基本原则
拓展
React.Native 有时间了解一下 用来开发WX小程序的
- React-redux 实现了组件和redux的桥梁