成功操作通道后执行PUT操作

时间:2020-08-28 16:16:18

标签: javascript reactjs redux-saga

我有个传奇故事

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 频道吗?

0 个答案:

没有答案