mirror of
https://github.com/plankanban/planka.git
synced 2025-12-23 09:15:09 +03:00
Initial commit
This commit is contained in:
21
client/src/store.js
Executable file
21
client/src/store.js
Executable file
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user