react redux 怎么同时发送多个action
3 回答

慕虎7371278
TA贡献1802条经验 获得超4个赞
react 多个 action 名字重复了 覆盖怎么办
题主的问题本身是存在概念混淆的。
1. store是前端数据库的概念,而且只存在于runtime,负责调度一切。
2. 执行增删改查的任务是通过reducer进行执行的,可以类比后端数据库中的sql语句。
3. 整个流程如下
action ===> reducer ===> newStore
4. 如果涉及到网络请求的后端数据库调度,也是action发起,在获取数据后由reducer加工返回store。 当然了,在async场景下,你需要redux-thunk来处理

DIEA
TA贡献1820条经验 获得超2个赞
通常正常的结构是: export function myAction(id) { return { type: 'floor', loadStatus: 'loading', loadNum: id } } reducer:
添加回答
举报
0/150
提交
取消