Answers for "redux-persist with saga"

0

redux-persist with saga

import { all, fork, take } from 'redux-saga/effects';
import { REHYDRATE } from 'redux-persist/lib/constants';
import { mySagaA, mySagaB, mySagaC } from './mySagas';

function* rootSaga() {
  console.log("Waiting for rehydration")
  yield take(REHYDRATE); // Wait for rehydrate to prevent sagas from running with empty store
  console.log("Rehydrated")
  yield all([
    fork(mySagaA),
    fork(mySagaB),
    fork(mySagaC),
  ]);
}
Posted by: Guest on October-16-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language