Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redux-saga with Redux Toolkit - effects do not run #767

Closed
Sun-2 opened this issue Oct 20, 2020 · 1 comment
Closed

redux-saga with Redux Toolkit - effects do not run #767

Sun-2 opened this issue Oct 20, 2020 · 1 comment

Comments

@Sun-2
Copy link

Sun-2 commented Oct 20, 2020

I've got a CRA setup with @reduxjs/toolkit and redux-saga.

The main saga does run. However, sub-sagas that are meant to be run on takeEvery or fork, do not seem to run at all.

Saga:

export function* saga() {
  console.log('main'); //logs

  fork(function* () {
    console.log('fork') //doesn't log
  });
}

Store:

const sagaMiddleware = createSagaMiddleware();
const store = configureStore({
  reducer: state => {
  },
  middleware: defaultMiddleware => defaultMiddleware().concat(sagaMiddleware)
});

sagaMiddleware.run(saga);

Repo link. (Nothing but CRA + Toolkit + redux-saga)

Related SO thread.

@markerikson
Copy link
Collaborator

Since sagas are an entirely separate middleware, the behavior is going to be independent of whether you're using RTK or the Redux core. configureStore doesn't do anything special in that regard.

SO or the saga repo are the right place to ask about this. Since you've got an SO question open, I'll go ahead and close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants