Skip to content

Commit

Permalink
enable redux-dev-tools extension if present in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kraynel committed Oct 2, 2018
1 parent 811bc01 commit 12cbb71
Showing 1 changed file with 7 additions and 3 deletions.
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

0 comments on commit 12cbb71

Please sign in to comment.