简体   繁体   中英

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)
  };
};

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM