1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-08-01 19:45:26 +02:00
planka/client/src/store.js

22 lines
645 B
JavaScript
Raw Normal View History

2019-08-31 04:07:25 +05:00
import { applyMiddleware, createStore } from 'redux';
import createSagaMiddleware from 'redux-saga';
import { routerMiddleware } from 'connected-react-router';
import rootReducer from './reducers';
import rootSaga from './sagas';
import history from './history';
const sagaMiddleware = createSagaMiddleware();
const middlewares = [sagaMiddleware, routerMiddleware(history)];
if (process.env.NODE_ENV !== 'production') {
const { logger } = require('redux-logger'); // eslint-disable-line global-require
middlewares.push(logger);
}
export default createStore(rootReducer, applyMiddleware(...middlewares));
sagaMiddleware.run(rootSaga);