Skip to content

Instantly share code, notes, and snippets.

@GaetanoPiazzolla
Created January 19, 2022 16:15
Show Gist options
  • Save GaetanoPiazzolla/ddb05ff53f6bfe5d369c0215954f0502 to your computer and use it in GitHub Desktop.
Save GaetanoPiazzolla/ddb05ff53f6bfe5d369c0215954f0502 to your computer and use it in GitHub Desktop.
const store = createStore().setTables({pets: {fido: {sold: false}}});
const checkpoints = createCheckpoints(store);
checkpoints.setSize(200);
store.setCell('pets', 'fido', 'sold', true);
checkpoints.addCheckpoint('sale');
console.log(store.getCell('pets', 'fido', 'sold'));
// -> true
checkpoints.goBackward();
console.log(store.getCell('pets', 'fido', 'sold'));
// -> false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment