Skip to content

added redux-dev-tools and composeWithDevTools#6

Open
koopcodes wants to merge 1 commit intomaisonm:masterfrom
koopcodes:composeWithDevTools
Open

added redux-dev-tools and composeWithDevTools#6
koopcodes wants to merge 1 commit intomaisonm:masterfrom
koopcodes:composeWithDevTools

Conversation

@koopcodes
Copy link

As it was written /client/src/store/index.js would only work for me using Chrome browser with the Redux DevTools extension installed. By adding npm package redux-dev-tools to client package.json and some changes to /client/src/store/index.js it now runs in all browsers I was able to test

@@ -1,16 +1,15 @@
import { createStore, applyMiddleware, compose } from 'redux';
import { createStore, applyMiddleware } from 'redux';
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer need to import compose.....

import createSagaMiddleware from 'redux-saga';
import rootReducer from './reducers/index';
import rootSaga from './sagas/index';
import { composeWithDevTools } from 'redux-devtools-extension';
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because we are importing and going to use composeWithDevTools

compose(applyMiddleware(sagaMiddleware), reduxDevTools)
);
composeWithDevTools(applyMiddleware(sagaMiddleware))
);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to assign DevTools as a constant and include it in the compose, composeWithDevTools alone is sufficient

"react-scripts": "1.1.4",
"redux": "^4.0.0"
},
"devDependencies": {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locally it worked for me installing redux-dev-tools as a client dev dependency but in order to have it deploy to Heroku I had to include it in the root package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant