Added alert to install redux devtool (#1228)

* Added alert to install redux devtool

* Change to warning
This commit is contained in:
vera-liu 2016-09-30 15:02:52 -07:00 committed by GitHub
parent aa5bbe6149
commit d066f8b726
1 changed files with 9 additions and 3 deletions

View File

@ -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;
}