Created
March 18, 2022 12:17
-
-
Save paveltretyakovru/bdf23071c1bfc187efd1383fdd9d3e53 to your computer and use it in GitHub Desktop.
redux + saga (fix to getDefaultMiddleware is deprecated)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import createSagaMiddleware from 'redux-saga'; | |
import { configureStore } from '@reduxjs/toolkit'; | |
import saga from './saga'; | |
import { reducer as app } from 'app/app.slice'; | |
import { counterSlice } from 'core/features/counter/counter.slice'; | |
const sagaMiddleware = createSagaMiddleware(); | |
export const store = configureStore({ | |
reducer: { | |
app, | |
counter: counterSlice.reducer, | |
}, | |
middleware: (getDefaultMiddleware) => | |
getDefaultMiddleware().concat(sagaMiddleware), | |
}); | |
sagaMiddleware.run(saga); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment