Last active
December 17, 2020 11:54
-
-
Save daverivera/55f2cff6e1f7b43d80fe86d713e3a5dd to your computer and use it in GitHub Desktop.
redux-crosstab_persist_listener
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getStoredState, REHYDRATE } from 'redux-persist' | |
export default | |
function crossBrowserListener(store, persistConfig) { | |
return async function() { | |
let state = await getStoredState(persistConfig) | |
store.dispatch({ | |
type: REHYDRATE, | |
key: persistConfig.key, | |
payload: state, | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment