Last active
October 6, 2018 10:48
-
-
Save productioncoder/9b5de16ae83b6bee294a9a6b59954cd5 to your computer and use it in GitHub Desktop.
Youtube Redux store Redux DevTools setup
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 {applyMiddleware, compose, createStore} from 'redux'; | |
import reducer from './reducers'; | |
import createSagaMiddleware from 'redux-saga'; | |
import rootSaga from './sagas'; | |
export function configureStore() { | |
const sagaMiddleware = createSagaMiddleware(); | |
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; | |
const store = createStore(reducer, composeEnhancers( | |
applyMiddleware(sagaMiddleware) | |
)); | |
sagaMiddleware.run(rootSaga); | |
return store; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment