Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
Enable redux-devtools and remove logger middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Nizar-Rahme authored and Chi Nguyen committed Feb 14, 2019
1 parent fe570cd commit fc0ea20
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
5 changes: 3 additions & 2 deletions app/store/configureStore.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
10 changes: 0 additions & 10 deletions app/store/middleware/index.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
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),
applyMiddleware(tracking),
persistState,
];

if (isDevelopment) {
const loggerMiddleware = createLogger({
collapsed: true,
duration: true,
});
storeEnhancers.push(applyMiddleware(loggerMiddleware));
}

export default storeEnhancers;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit fc0ea20

Please sign in to comment.