Skip to content

Commit

Permalink
feat(core): Update Redux DevTools Extension's usage according to new …
Browse files Browse the repository at this point in the history
  • Loading branch information
zalmoxisus authored and mxstbr committed Nov 2, 2016
1 parent 307c8d3 commit c1551f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 0 additions & 9 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ import { translationMessages } from './i18n';
const initialState = {};
const store = configureStore(initialState, browserHistory);

// If you use Redux devTools extension, since v2.0.1, they added an
// `updateStore`, so any enhancers that change the store object
// could be used with the devTools' store.
// As this boilerplate uses Redux & Redux-Saga, the `updateStore` is needed
// if you want to `take` actions in your Sagas, dispatched from devTools.
if (window.devToolsExtension) {
window.devToolsExtension.updateStore(store);
}

// Sync history and store, as the react-router-redux reducer
// is under the non-default key ("routing"), selectLocationState
// must be provided for resolving how to retrieve the "route" in the state
Expand Down
9 changes: 6 additions & 3 deletions app/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import createSagaMiddleware from 'redux-saga';
import createReducer from './reducers';

const sagaMiddleware = createSagaMiddleware();
const devtools = window.devToolsExtension || (() => (noop) => noop);

export default function configureStore(initialState = {}, history) {
// Create the store with two middlewares
Expand All @@ -22,13 +21,17 @@ export default function configureStore(initialState = {}, history) {

const enhancers = [
applyMiddleware(...middlewares),
devtools(),
];

// If Redux DevTools Extension is installed use it, otherwise use Redux compose
/* eslint-disable no-underscore-dangle */
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
/* eslint-enable */

const store = createStore(
createReducer(),
fromJS(initialState),
compose(...enhancers)
composeEnhancers(...enhancers)
);

// Extensions
Expand Down

0 comments on commit c1551f6

Please sign in to comment.