mangocaptain
mangocaptain

Reputation: 1495

How does the prop `store` work in react-redux Provider?

In this tutorial, the author exports the below code and passes the entire called function, which returns an object, to the store prop in Provider. How does the runSaga part get ran? I don't see this in the docs.

const configureStore = () => {
  const sagaMiddleware = createSagaMiddleware(); 
  return {
    ...createStore(rootReducer,
      applyMiddleware(sagaMiddleware)),
    runSaga: sagaMiddleware.run(rootSaga)
  };
};

Upvotes: 0

Views: 68

Answers (1)

Ematipico
Ematipico

Reputation: 1244

I guess it's missing from the tutorial.

Look at the example at the official page of redux-saga.

The example explicitly calls the function runSaga

Upvotes: 1

Related Questions