-
-
Save DubiousS/20b329b11568bb9a3a6ec90470025a49 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { createStore, applyMiddleware } from 'redux'; | |
| import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly'; | |
| import rootReducer from './root-reducer'; | |
| import createHistory from 'history/createBrowserHistory'; | |
| import { connectRouter, routerMiddleware } from 'connected-react-router'; | |
| import createSagaMidleware from 'redux-saga'; | |
| import rootSaga from './root-saga'; | |
| export const history = createHistory(); | |
| const sagaMidleware = createSagaMidleware(); | |
| const midlewares = [ | |
| routerMiddleware(history), | |
| sagaMidleware, | |
| ]; | |
| export const store = createStore( | |
| connectRouter(history)(rootReducer), | |
| {}, | |
| composeWithDevTools( | |
| applyMiddleware( | |
| ...midlewares | |
| ) | |
| ) | |
| ); | |
| sagaMidleware.run(rootSaga); | |
| export default store; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment