2018-07-02 14:50:13 +02:00
|
|
|
import thunk from 'redux-thunk';
|
|
|
|
|
import logger from 'redux-logger';
|
|
|
|
|
import { createStore, compose, applyMiddleware, combineReducers } from 'redux';
|
|
|
|
|
import { routerReducer, routerMiddleware } from 'react-router-redux';
|
|
|
|
|
|
|
|
|
|
import page from './modules/page';
|
2018-07-02 16:05:58 +02:00
|
|
|
import users from './modules/users';
|
2018-07-02 14:50:13 +02:00
|
|
|
|
|
|
|
|
function createReduxStore(history) {
|
|
|
|
|
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
|
|
|
|
|
|
|
|
|
|
const reducer = combineReducers({
|
|
|
|
|
router: routerReducer,
|
2018-07-02 16:05:58 +02:00
|
|
|
page,
|
|
|
|
|
users
|
2018-07-02 14:50:13 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return createStore(
|
|
|
|
|
reducer,
|
|
|
|
|
composeEnhancers(applyMiddleware(routerMiddleware(history), thunk, logger))
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default createReduxStore;
|