Skip to content

Instantly share code, notes, and snippets.

@GaetanoPiazzolla
Created January 19, 2022 16:43
Show Gist options
  • Save GaetanoPiazzolla/51fc7a98b6449dd8b2e98b08f7a3f653 to your computer and use it in GitHub Desktop.
Save GaetanoPiazzolla/51fc7a98b6449dd8b2e98b08f7a3f653 to your computer and use it in GitHub Desktop.
sessionStorage.setItem('pets', '{"pets":{"fido":{"species":"dog"}}}');
const store = createStore();
const persister = createSessionPersister(store, 'pets');
await persister.load();
console.log(store.getTables());
// -> {pets: {fido: {species: 'dog'}}}
sessionStorage.clear();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment