diff --git a/console/README.md b/console/README.md index 510511d778a14..dd6d626954ccc 100644 --- a/console/README.md +++ b/console/README.md @@ -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` diff --git a/console/src/client.js b/console/src/client.js index 595c4821364fa..913aa36b651ed 100755 --- a/console/src/client.js +++ b/console/src/client.js @@ -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))