Skip to content

Commit

Permalink
Replaced deprecated window.devToolsExtension for new API
Browse files Browse the repository at this point in the history
  • Loading branch information
joeynguyen committed Nov 30, 2016
1 parent ca7fcf7 commit 93acdfe
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/store/configureStore.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,18 @@ const logger = createLogger({

const router = routerMiddleware(hashHistory);

const enhancer = compose(
const composeEnhancers =
process.env.NODE_ENV !== 'production' &&
typeof window === 'object' &&
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ actionCreators }) : compose;

const enhancer = composeEnhancers(
applyMiddleware(thunk, router, logger),
window.devToolsExtension ?
window.devToolsExtension({ actionCreators }) :
noop => noop
);

export default function configureStore(initialState) {
const store = createStore(rootReducer, initialState, enhancer);

if (window.devToolsExtension) {
window.devToolsExtension.updateStore(store);
}

if (module.hot) {
module.hot.accept('../reducers.js', () =>
store.replaceReducer(require('../reducers.js')) // eslint-disable-line global-require
Expand Down

0 comments on commit 93acdfe

Please sign in to comment.