[SQLLab] Fix the usage of Redux DevTools Enhancer (#1278)

* Fix the usage of Redux DevTools Enhancer

* Fix ESLint error
This commit is contained in:
Mihail Diordiev 2016-10-12 01:27:25 +03:00 committed by Maxime Beauchemin
parent 1e6e144d24
commit 79460abdd2

View File

@ -67,9 +67,10 @@ 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()
);
/* eslint-disable no-underscore-dangle */
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
/* eslint-enable */
enhancerWithPersistState = composeEnhancers(persistState());
}
return enhancerWithPersistState;
}