Skip to content

Instantly share code, notes, and snippets.

@kiok46
Created June 10, 2018 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kiok46/dc2f5ab05412b903881ca509d257edc7 to your computer and use it in GitHub Desktop.
Save kiok46/dc2f5ab05412b903881ca509d257edc7 to your computer and use it in GitHub Desktop.
Redux, Reactotron, Actions, Reducers and Sagas (2)
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