Skip to content

Commit

Permalink
Added alert to install redux devtool (apache#1228)
Browse files Browse the repository at this point in the history
* Added alert to install redux devtool

* Change to warning
  • Loading branch information
vera-liu authored Sep 30, 2016
1 parent aa5bbe6 commit d066f8b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions caravel/assets/javascripts/reduxUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,15 @@ export function addToArr(state, arrKey, obj) {
export function enhancer() {
let enhancerWithPersistState = compose(persistState());
if (process.env.NODE_ENV === 'dev') {
enhancerWithPersistState = compose(
persistState(), window.devToolsExtension && window.devToolsExtension()
);
if (window.devToolsExtension) {
enhancerWithPersistState = compose(
persistState(), window.devToolsExtension && window.devToolsExtension()
);
} else {
console.warn('You may encounter errors unless' +
'you have Redux Devtool Extension installed: ' +
'http://github.com/zalmoxisus/redux-devtools-extension');
}
}
return enhancerWithPersistState;
}

0 comments on commit d066f8b

Please sign in to comment.