Created
June 10, 2018 11:53
-
-
Save kiok46/dc2f5ab05412b903881ca509d257edc7 to your computer and use it in GitHub Desktop.
Redux, Reactotron, Actions, Reducers and Sagas (2)
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 { createStore, compose, applyMiddleware } from 'redux'; | |
import createSagaMiddleware from 'redux-saga'; | |
import { sagaMonitor } from '../../configs'; | |
import reducers from '../reducers'; // Our Reducers | |
import rootSaga from '../sagas'; // Our Sagas | |
const middleWare = []; | |
// Setup Redux-Saga | |
const sagaMiddleware = createSagaMiddleware({ sagaMonitor }); | |
middleWare.push(sagaMiddleware); | |
const store = createStore(reducers, {}, compose(applyMiddleware(...middleWare))); | |
// Initiate the root saga. | |
sagaMiddleware.run(rootSaga); | |
export default store; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment