redux、react-redux、redux-thunk、redux-saga对比
redux
redux工作流程示意图
actions
函数形式,返回 action 对象,通常具有type属性。负责指令的生成,页面通过 store.dispatch(action) 向 store 发送数据修改的请求。
reducers
一个纯函数,接收两个参数 (previousState, action) 第一个表示修改之前的 state 的值,action 是上一步页面通过 store.dispatch(action) 向 store 传递的 action。reducers 通过 ac
原创
2022-05-07 13:45:50 ·
996 阅读 ·
1 评论