mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
Enable Redux DevTools in development mode
This commit is contained in:
parent
5f2c24b428
commit
a837f5dfd2
1 changed files with 10 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
import { applyMiddleware, createStore } from 'redux';
|
||||
import { applyMiddleware, createStore, compose as reduxCompose } from 'redux';
|
||||
import createSagaMiddleware from 'redux-saga';
|
||||
import { routerMiddleware } from 'connected-react-router';
|
||||
|
||||
|
@ -10,12 +10,19 @@ const sagaMiddleware = createSagaMiddleware();
|
|||
|
||||
const middlewares = [sagaMiddleware, routerMiddleware(history)];
|
||||
|
||||
let compose = reduxCompose;
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const { logger } = require('redux-logger'); // eslint-disable-line global-require
|
||||
|
||||
middlewares.push(logger);
|
||||
|
||||
// enable Redux Devtools in development
|
||||
// https://github.com/zalmoxisus/redux-devtools-extension
|
||||
if (typeof window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ !== 'undefined') {
|
||||
compose = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
||||
}
|
||||
}
|
||||
|
||||
export default createStore(rootReducer, applyMiddleware(...middlewares));
|
||||
export default createStore(rootReducer, compose(applyMiddleware(...middlewares)));
|
||||
|
||||
sagaMiddleware.run(rootSaga);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue