Created
May 29, 2019 11:47
-
-
Save daverivera/2c6f8ff87c08bc237e084f627c8172a0 to your computer and use it in GitHub Desktop.
redux-crosstab_localstorage_storage-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
export function createStorageListener(store) { | |
return () => { | |
const wrappedAction = JSON.parse(localStorage.getItem(storageKey)) | |
delete wrappedAction.source | |
store.dispatch(wrappedAction) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment