Skip to content

Commit

Permalink
fix(internals): reducer stacking hotfix (react-boilerplate#976)
Browse files Browse the repository at this point in the history
  • Loading branch information
justingreenberg authored and mxstbr committed Sep 12, 2016
1 parent 683eb51 commit d38ab17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/utils/asyncInjectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export function injectAsyncReducer(store, isValid) {
'(app/utils...) injectAsyncReducer: Expected `asyncReducer` to be a reducer function'
);

if (Reflect.has(store.asyncReducers, name)) return;

store.asyncReducers[name] = asyncReducer; // eslint-disable-line no-param-reassign
store.replaceReducer(createReducer(store.asyncReducers));
};
Expand Down
2 changes: 2 additions & 0 deletions internals/templates/asyncInjectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export function injectAsyncReducer(store, isValid) {
'(app/utils...) injectAsyncReducer: Expected `asyncReducer` to be a reducer function'
);

if (Reflect.has(store.asyncReducers, name)) return;

store.asyncReducers[name] = asyncReducer; // eslint-disable-line no-param-reassign
store.replaceReducer(createReducer(store.asyncReducers));
};
Expand Down

0 comments on commit d38ab17

Please sign in to comment.