From fc0ea203829fef53f4cf83fec8bc0f2239c28c8d Mon Sep 17 00:00:00 2001 From: Nizar Rahme Date: Thu, 14 Feb 2019 15:49:59 +0200 Subject: [PATCH] Enable redux-devtools and remove logger middleware --- app/store/configureStore.js | 5 +++-- app/store/middleware/index.js | 10 ---------- package.json | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/app/store/configureStore.js b/app/store/configureStore.js index eccfc29ab..af3f11f58 100644 --- a/app/store/configureStore.js +++ b/app/store/configureStore.js @@ -1,9 +1,10 @@ -import { compose, createStore } from 'redux'; +import { createStore } from 'redux'; +import { composeWithDevTools } from 'redux-devtools-extension/logOnlyInProduction'; import rootReducer from 'state/rootReducer'; import middleware from './middleware'; -const finalCreateStore = compose(...middleware)(createStore); +const finalCreateStore = composeWithDevTools(...middleware)(createStore); function configureStore(initialState) { const store = finalCreateStore(rootReducer, initialState); diff --git a/app/store/middleware/index.js b/app/store/middleware/index.js index 838b02320..8217b4e6e 100644 --- a/app/store/middleware/index.js +++ b/app/store/middleware/index.js @@ -1,12 +1,10 @@ import { applyMiddleware } from 'redux'; import { apiMiddleware } from 'redux-api-middleware'; -import createLogger from 'redux-logger'; import thunk from 'redux-thunk'; import persistState from './persistState'; import tracking from './tracking'; -const isDevelopment = process.env.NODE_ENV !== 'production'; const storeEnhancers = [ applyMiddleware(thunk), applyMiddleware(apiMiddleware), @@ -14,12 +12,4 @@ const storeEnhancers = [ persistState, ]; -if (isDevelopment) { - const loggerMiddleware = createLogger({ - collapsed: true, - duration: true, - }); - storeEnhancers.push(applyMiddleware(loggerMiddleware)); -} - export default storeEnhancers; diff --git a/package.json b/package.json index e01facba8..9fdab77b7 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "react-transform-catch-errors": "1.0.2", "react-transform-hmr": "1.0.4", "redbox-react": "1.3.2", - "redux-logger": "2.7.0", + "redux-devtools-extension": "2.13.8", "resolve-url-loader": "2.0.2", "rosie": "1.6.0", "sass-loader": "4.1.1",