summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/js/src/index.js4
-rw-r--r--src/main/js/src/store.js11
2 files changed, 7 insertions, 8 deletions
diff --git a/src/main/js/src/index.js b/src/main/js/src/index.js
index 31ddded9..cfe654b5 100644
--- a/src/main/js/src/index.js
+++ b/src/main/js/src/index.js
@@ -7,10 +7,6 @@ import configureStore from './store'
const initialState = {}
const store = configureStore(initialState)
-if (window.devToolsExtension) {
- window.devToolsExtension.updateStore(store)
-}
-
import './index.css'
import App from './containers/App'
diff --git a/src/main/js/src/store.js b/src/main/js/src/store.js
index 8cf7fa21..d4885275 100644
--- a/src/main/js/src/store.js
+++ b/src/main/js/src/store.js
@@ -2,19 +2,22 @@ import { createStore, compose } from 'redux'
import createReducer from './reducers'
-const devtools = window.devToolsExtension || (() => noop => noop)
-
export default function configureStore(initialState = {}) {
const middlewares = []
const enhancers = [
- devtools()
]
+ const composeEnhancers =
+ process.env.NODE_ENV !== 'production' &&
+ typeof window === 'object' &&
+ window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
+ window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : compose;
+
const store = createStore(
createReducer(),
initialState,
- compose(...enhancers)
+ composeEnhancers(...enhancers)
)
return store
bgstack15