@@ -34,7 +34,7 @@ const __REDUX_DEVTOOLS_EXTENSION__ = function(reducer, preloadedState, config) {
34
34
35
35
let store ;
36
36
let errorOccurred = false ;
37
- let maxAge ;
37
+ let maxAge = config . maxAge ;
38
38
let actionCreators ;
39
39
let sendingActionId = 1 ;
40
40
const instanceId = generateId ( config . instanceId ) ;
@@ -91,7 +91,7 @@ const __REDUX_DEVTOOLS_EXTENSION__ = function(reducer, preloadedState, config) {
91
91
92
92
if ( type === 'ACTION' ) {
93
93
message . action = ! actionSanitizer ? action : actionSanitizer ( action . action , nextActionId - 1 ) ;
94
- message . maxAge = maxAge ;
94
+ message . maxAge = getMaxAge ( ) ;
95
95
message . nextActionId = nextActionId ;
96
96
} else if ( libConfig ) {
97
97
message . libConfig = libConfig ;
@@ -144,7 +144,7 @@ const __REDUX_DEVTOOLS_EXTENSION__ = function(reducer, preloadedState, config) {
144
144
payload,
145
145
source,
146
146
instanceId,
147
- maxAge
147
+ maxAge : getMaxAge ( )
148
148
} , serializeState , serializeAction ) ;
149
149
} , latency ) ;
150
150
@@ -233,9 +233,9 @@ const __REDUX_DEVTOOLS_EXTENSION__ = function(reducer, preloadedState, config) {
233
233
}
234
234
}
235
235
236
- function init ( ) {
237
- maxAge = config . maxAge || window . devToolsOptions . maxAge || 50 ;
236
+ const getMaxAge = ( ) => maxAge || window . devToolsOptions . maxAge || 50 ;
238
237
238
+ function init ( ) {
239
239
setListener ( onMessage , instanceId ) ;
240
240
notifyErrors ( ( ) => {
241
241
errorOccurred = true ;
@@ -274,7 +274,7 @@ const __REDUX_DEVTOOLS_EXTENSION__ = function(reducer, preloadedState, config) {
274
274
if ( ! isAllowed ( window . devToolsOptions ) ) return next ( reducer_ , initialState_ , enhancer_ ) ;
275
275
276
276
store = stores [ instanceId ] =
277
- configureStore ( next , monitor . reducer , config ) ( reducer_ , initialState_ , enhancer_ ) ;
277
+ configureStore ( next , monitor . reducer , { ... config , maxAge : getMaxAge } ) ( reducer_ , initialState_ , enhancer_ ) ;
278
278
279
279
if ( isInIframe ( ) ) setTimeout ( init , 3000 ) ;
280
280
else init ( ) ;
0 commit comments