Pass enhancer through as per Redux 3.1 changes

This commit is contained in:
Dan Abramov 2016-01-28 19:15:02 +00:00
parent 4333826cab
commit 2d4369fcab
2 changed files with 4 additions and 4 deletions

View File

@ -334,12 +334,12 @@ function unliftStore(liftedStore, liftReducer) {
* Redux instrumentation store enhancer.
*/
export default function instrument(monitorReducer = () => null) {
return createStore => (reducer, initialState) => {
return createStore => (reducer, initialState, enhancer) => {
function liftReducer(r) {
return liftReducerWith(r, initialState, monitorReducer);
}
const liftedStore = createStore(liftReducer(reducer));
const liftedStore = createStore(liftReducer(reducer), undefined, enhancer);
return unliftStore(liftedStore, liftReducer);
};
}

View File

@ -21,7 +21,7 @@ export default function persistState(sessionId, deserializeState = identity, des
};
}
return next => (reducer, initialState) => {
return next => (reducer, initialState, enhancer) => {
const key = `redux-dev-session-${sessionId}`;
let finalInitialState;
@ -40,7 +40,7 @@ export default function persistState(sessionId, deserializeState = identity, des
}
}
const store = next(reducer, finalInitialState);
const store = next(reducer, finalInitialState, enhancer);
return {
...store,