Skip to content

Instantly share code, notes, and snippets.

@daverivera
Created May 29, 2019 11:47
Show Gist options
  • Save daverivera/2c6f8ff87c08bc237e084f627c8172a0 to your computer and use it in GitHub Desktop.
Save daverivera/2c6f8ff87c08bc237e084f627c8172a0 to your computer and use it in GitHub Desktop.
redux-crosstab_localstorage_storage-listener
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