mirror of
https://github.com/reactos/developer-web-interface.git
synced 2025-05-15 11:05:54 +00:00
Added redux-logger
This commit is contained in:
parent
aceb7cf635
commit
7bd218c3d6
@ -14,6 +14,7 @@
|
|||||||
"react-tabs": "^3.0.0",
|
"react-tabs": "^3.0.0",
|
||||||
"reactstrap": "^8.0.0",
|
"reactstrap": "^8.0.0",
|
||||||
"redux": "^4.0.1",
|
"redux": "^4.0.1",
|
||||||
|
"redux-logger": "^3.0.6",
|
||||||
"redux-saga": "^1.0.2"
|
"redux-saga": "^1.0.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -1,20 +1,22 @@
|
|||||||
import { createStore, applyMiddleware, compose } from 'redux';
|
import { createStore, applyMiddleware, compose } from 'redux';
|
||||||
import rootReducer from '../reducers';
|
|
||||||
import createSagaMiddleware from 'redux-saga';
|
import createSagaMiddleware from 'redux-saga';
|
||||||
|
import logger from 'redux-logger';
|
||||||
|
import rootReducer from '../reducers';
|
||||||
import rootSaga from '../sagas';
|
import rootSaga from '../sagas';
|
||||||
|
|
||||||
const configureStore = () => {
|
const configureStore = () => {
|
||||||
const sagaMiddleware = createSagaMiddleware();
|
const sagaMiddleware = createSagaMiddleware();
|
||||||
const store = createStore(
|
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
|
||||||
rootReducer,
|
const middlewares = [sagaMiddleware];
|
||||||
window.__REDUX_DEVTOOLS_EXTENSION__
|
|
||||||
? compose(
|
if (process.env.NODE_ENV === 'development') {
|
||||||
applyMiddleware(sagaMiddleware),
|
middlewares.push(logger)
|
||||||
window.__REDUX_DEVTOOLS_EXTENSION__()
|
}
|
||||||
)
|
|
||||||
: applyMiddleware(sagaMiddleware)
|
const store = createStore(rootReducer, undefined, composeEnhancers(applyMiddleware(...middlewares)));
|
||||||
);
|
|
||||||
sagaMiddleware.run(rootSaga);
|
sagaMiddleware.run(rootSaga);
|
||||||
return store;
|
return store;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default configureStore;
|
export default configureStore;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user