Skip to content

Commit ec57dc5

Browse files
author
Piotr Rosłaniec
committed
Dispatch action to init reducer state
1 parent 5ec626d commit ec57dc5

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

app/configureStore.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export default function configureStore(initialState = {}, history) {
5353
if (module.hot) {
5454
module.hot.accept('./reducers', () => {
5555
store.replaceReducer(createReducer(store.injectedReducers));
56+
store.dispatch({ type: '@@REDUCER_INJECTED' });
5657
});
5758
}
5859

app/utils/reducerInjectors.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export function injectReducerFactory(store, isValid) {
2020

2121
store.injectedReducers[key] = reducer; // eslint-disable-line no-param-reassign
2222
store.replaceReducer(createReducer(store.injectedReducers));
23+
store.dispatch({ type: '@@REDUCER_INJECTED' });
2324
};
2425
}
2526

0 commit comments

Comments
 (0)