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

store.runSagaTask is not a function #3878

Closed
mtsymlov opened this issue Feb 23, 2018 · 0 comments
Closed

store.runSagaTask is not a function #3878

mtsymlov opened this issue Feb 23, 2018 · 0 comments

Comments

@mtsymlov
Copy link

When working with the [email protected], the following problem occurs when navigating through pages:

store.runSagaTask is not a function TypeError: store.runSagaTask is not a function at Function._callee$ (http://localhost:3030/_next/-/page/main.js:68018:29) at tryCatch (http://localhost:3030/_next/-/main.js:12074:40) at Generator.invoke [as _invoke] (http://localhost:3030/_next/-/main.js:12308:22) at Generator.prototype.(anonymous function) [as next] (http://localhost:3030/_next/-/main.js:12126:21) at step (http://localhost:3030/_next/-/page/main.js:67952:191) at http://localhost:3030/_next/-/page/main.js:67952:361 at <anonymous>

It solves the creation of the store.runSagaTask method in the configureStore and the subsequent invocation of this method:

Before:

const configureStore = () => {
  const store = createStore(
    reducer,
    composeWithDevTools(applyMiddleware(sagaMiddleware, logger)),
  );

  store.sagaTask = sagaMiddleware.run(saga);
  return store;
};

After:

const configureStore = () => {
  const store = createStore(
    reducer,
    composeWithDevTools(applyMiddleware(sagaMiddleware, logger)),
  );

  store.runSagaTask = () => {
    store.sagaTask = sagaMiddleware.run(saga);
  };

  store.runSagaTask();
  return store;
};
@lock lock bot locked as resolved and limited conversation to collaborators Feb 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant