Skip to content

Commit b1aff29

Browse files
committed
add deserialize callbacks for persistState
1 parent f05719d commit b1aff29

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/app/store/configureStore.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import { compose } from 'redux';
22
import { persistState, instrument } from 'redux-devtools';
33

4-
export default function configureStore(next, subscriber = () => ({})) {
4+
export default function configureStore(next, subscriber = () => ({}), options = {}) {
5+
const { deserializeState, deserializeAction } = options;
56
return compose(
67
instrument(subscriber),
78
persistState(
8-
getPersistSession()
9+
getPersistSession(),
10+
deserializeState,
11+
deserializeAction
912
)
1013
)(next);
1114
}

src/browser/extension/inject/pageScript.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,11 @@ window.devToolsExtension = function(config = {}) {
140140
return (reducer, initialState, enhancer) => {
141141
if (!isAllowed(window.devToolsOptions)) return next(reducer, initialState, enhancer);
142142

143-
store = configureStore(next, monitorReducer)(reducer, initialState, enhancer);
143+
const { deserializeState, deserializeAction } = config;
144+
store = configureStore(next, monitorReducer, {
145+
deserializeState,
146+
deserializeAction
147+
})(reducer, initialState, enhancer);
144148
init();
145149
store.subscribe(() => { handleChange(store.getState(), store.liftedStore.getState()); });
146150
return store;

0 commit comments

Comments
 (0)