Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable redux-dev-tools if present in dev mode (closes #606) #607

Merged
merged 3 commits into from Oct 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions console/README.md
Expand Up @@ -126,6 +126,9 @@ When adding a new feature, it is recommended to add corresponding tests too.

Tests are written using [Cypress](https://www.cypress.io/).

You can use the [Redux DevTools Extension](http://extension.remotedev.io/) to inspect and debug the Redux store.
It should automatically connect to the Redux store when started in development mode.

### Run Tests

- Run tests: `npm run cypress`
Expand Down
10 changes: 7 additions & 3 deletions console/src/client.js
Expand Up @@ -24,12 +24,16 @@ import globals from './Globals';
let _finalCreateStore;

if (__DEVELOPMENT__) {
_finalCreateStore = compose(
const tools = [
applyMiddleware(thunk, routerMiddleware(browserHistory), createLogger()),
require('redux-devtools').persistState(
window.location.href.match(/[?&]debug_session=([^&]+)\b/)
)
)(createStore);
),
];
if (typeof window === 'object' && window.__REDUX_DEVTOOLS_EXTENSION__) {
tools.push(window.__REDUX_DEVTOOLS_EXTENSION__());
}
_finalCreateStore = compose(...tools)(createStore);
} else {
_finalCreateStore = compose(
applyMiddleware(thunk, routerMiddleware(browserHistory))
Expand Down