K
K
Kafkae2019-02-21 12:59:47
JavaScript
Kafkae, 2019-02-21 12:59:47

Bug with redux-saga?

Hello.
I'm working with a saga and I get an error - Before running a Saga, you must mount the Saga middleware on the Store using applyMiddleware .
I broke my whole head what is wrong, I don’t understand why it happens. Writes an error in configureStore.js https://codesandbox.io/s/l4qjorjxjq . Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
davidnum95, 2019-02-21
@Kafkae

You start the saga before the store is created.

const configureStore = history => {
  const store = createStore(
    rootReducer(history),
    composeWithDevTools(
      applyMiddleware(routerMiddleware(history), sagaMiddleware, logger)
    )
  );
  sagaMiddleware.run(rootSaga);
  return store;
};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question