这是dva文档中的一部分,里面用了call来调用某个model下effect的方法

这样用的应该是为了同步顺序调用几个effect
但实际在代码中使用好像call只能传入function参数
*abc({ payload }, {put, call,take}) {
yield call({type: 'a/b',payload: {...}});
},
报错
index.js:1 uncaught at check call: argument [object Object] is not a function
不知道是我理解错了,还是使用有问题? 求教大佬
"dva": "^2.4.0",
同步调用 effect 使用 put.resolve
https://github.com/redux-saga/redux-saga/tree/v0.16.2/docs/api#putresolveaction
后续流程你可以通过componentWillReceive或者componentUpdated中判断并执行
你可以去看看redux-saga的文档 会帮助理解dva的call、take、put等等
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
碰到同样问题+1 有大佬细说下么 现在用的 yield put({type: 'fetchCurrent'}); 但是是异步的
碰到同样问题+1 有大佬细说下么 现在用的 yield put({type: 'fetchCurrent'}); 但是是异步的
//同步阻塞其他action
yield put.resolve({type: 'fetchCurrent'});
//异步其他action
yield put({type: 'fetchCurrent'});
Most helpful comment
同步调用 effect 使用 put.resolve
https://github.com/redux-saga/redux-saga/tree/v0.16.2/docs/api#putresolveaction