UNPKG

acklen-keystone

Version:

Web Application Framework and Admin GUI / Content Management System built on Express.js and Mongoose

23 lines (20 loc) 743 B
import { createStore, combineReducers, applyMiddleware, compose } from 'redux'; import createHistory from 'history/createBrowserHistory'; import { routerReducer, routerMiddleware } from 'react-router-redux'; import thunk from 'redux-thunk'; import createSagaMiddleware from 'redux-saga'; import reducers from './reducers'; import rootSaga from './sagas'; const history = createHistory(); const sagaMiddleware = createSagaMiddleware(); const routeMiddleware = routerMiddleware(history); const middlewares = [thunk, sagaMiddleware, routeMiddleware]; const store = createStore( combineReducers({ ...reducers, router: routerReducer, }), compose(applyMiddleware(...middlewares)) ); sagaMiddleware.run(rootSaga); export { store, history };