-
Hi everyone, I'm asking here because I kind of don't understand how to merge my watchers with saga-query.. in essence I have this function* rootSaga () {
yield all([
fork(watchFetchPodcasts),
fork(watchFetchPodcastById),
fork(watchchangeFilterText),
fork(watchGetFilterResult),
])
}
const rootReducer = {
podcasts: podcastsReducer,
filter: filterReducer,
}
const store = configureStore({
reducer: rootReducer,
middleware: [sagaMiddleware],
})
sagaMiddleware.run(rootSagas) and now I'm supposed to use const api = createApi<ApiCtx>();
api.use(requestMonitor());
api.use(api.routes());
api.use(fetcher({ baseUrl: 'https://api.github.com/' }));
const prepared = prepareStore({
reducers: rootReducer,
sagas: { api: api.saga() },
})
const store = configureStore({
reducer: prepared.reducer,
middleware: prepared.middleware,
})
prepared.run() // <- shouldn't this be more like `prepared.run(rootSagas)`? Please, any help is welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello @well1791 , Hope it helps. Let me know if you have questions! |
Beta Was this translation helpful? Give feedback.
-
I think that the line that might help is here: https://github.com/VldMrgnn/react-redux-saga-query-vite/blob/65dab945f1687be33d40f01ae391dbe7b1fbc3f0/src/state/rootStore.ts#L18C17-L18C17 i.e. in your exmple, something like, const prepared = prepareStore({
reducers: rootReducer,
sagas: {
api: api.saga(),
root: rootSaga
}}) |
Beta Was this translation helpful? Give feedback.
I think that the line that might help is here: https://github.com/VldMrgnn/react-redux-saga-query-vite/blob/65dab945f1687be33d40f01ae391dbe7b1fbc3f0/src/state/rootStore.ts#L18C17-L18C17
i.e. in your exmple, something like,