1

What's the need of defining this statement like this in next-redux-wrapper makeStore: (store as SagaStore).sagaTask, instead of simply declaring sagaMiddleware.run(rootSaga);.

export const makeStore = (context) => {
    ...
    (store as SagaStore).sagaTask = sagaMiddleware.run(rootSaga);
    return store; };

Also, in individual pages, why do I need to declare this statement: await store.sagaTask.toPromise():

export const getStaticProps = wrapper.getStaticProps(async ({ store }) => {
 ...
await store.sagaTask.toPromise()
})
forest
  • 1,312
  • 3
  • 20
  • 47

0 Answers0