13

When using redux-connect (the @asynConnect attribute) how does one chain a second saga, that is dependent on a successful completion of the first saga?

Just simply putting the saga dispatch action in at the appropriate location in the first saga works on the client, but not on the server.

Bennidhamma
  • 730
  • 1
  • 7
  • 17
  • I was having the same struggle. I just found this, it saved my job : https://github.com/redux-saga/redux-saga/issues/984 – ArchNoob Nov 04 '17 at 06:58

1 Answers1

17

Calling a saga from another saga is as simply as doing a call effect.

yield call(firstSaga, params);

For example:

yield call(firstSaga);

//do something in current saga with whatever you save
//from the first saga in redux store

const data = select(firstSagaSelector);

yield call(myApi, data);
Daniel Andrei
  • 2,654
  • 15
  • 16