我有个传奇故事
function* saga1() {
yield fork(saga2);
yield all(
users.map((user) => put('action1', user))
);
console.log('finished'); // ---> gets logged immediately, doesnt wait for saga2
}
function* saga2() {
const channel = yield actionChannel('action1');
while (true) {
const r = yield take(channel);
yield call(api, r);
}
}
问题:是否有办法在完成saga2
的每个呼叫后之后采取某些措施?这样我就可以调度动作或saga2完成的任何 AFTER 频道吗?