File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,12 @@ export default function persistState(paths, config) {
3535 deserialize
3636 } = cfg
3737
38- return next => ( reducer , initialState ) => {
38+ return next => ( reducer , initialState , enhancer ) => {
39+ if ( typeof initialState === 'function' && typeof enhancer === 'undefined' ) {
40+ enhancer = initialState
41+ initialState = undefined
42+ }
43+
3944 let persistedState
4045 let finalInitialState
4146
@@ -46,7 +51,7 @@ export default function persistState(paths, config) {
4651 console . warn ( 'Failed to retrieve initialize state from localStorage:' , e )
4752 }
4853
49- const store = next ( reducer , finalInitialState )
54+ const store = next ( reducer , finalInitialState , enhancer )
5055 const slicerFn = slicer ( paths )
5156
5257 store . subscribe ( function ( ) {
You can’t perform that action at this time.
0 commit comments