redux
文章平均质量分 89
一只勤劳的二哈
If not now, when?If not me, who?
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
redux-thunk、redux-promise、redux-saga(利用中间件进行副作用处理)
利用中间件进行副作用处理redux-thunk、redux-promiseredux-saga redux-thunk、redux-promise redux-thunk thunk允许action是一个带有副作用的函数,当action是一个函数被分发时,thunk会阻止action继续向后移交。 thunk会向函数中传递三个参数: dispatch:来自于store.dispatch getState:来自于store.getState extra:来自于用户设置的额外参数 // disp原创 2021-05-16 22:11:44 · 502 阅读 · 0 评论 -
Redux的基本使用(api讲解)
React使用Redux管理数据React使用Redux管理数据ActionReducerStorecreateStoreRedux中间件(Middleware) React使用Redux管理数据 安装redux依赖 npm install redux 创建数据仓库 通过createStore函数来创建一个仓库,该函数接收两个参数(reducer, state), reducer(state, action):改变仓库数据的函数,state: 仓库的初始数据import { createSt原创 2021-05-16 22:06:28 · 514 阅读 · 0 评论
分享