tinyplex / tinybase

The reactive data store for local‑first apps.
https://tinybase.org
MIT License
3.71k stars 77 forks source link

Clear 'forward' checkpoints (clear redo stack) #105

Closed segments-tobias closed 10 months ago

segments-tobias commented 11 months ago

Is your feature request related to a problem? Please describe. After checkpoints.goBackward(), I want to make it impossible to redo the changes.

Describe the solution you'd like A method to clear the 'forward' checkpoints: e.g. checkpoints.clearForwardCheckpoints() or checkpoints.delForwardCheckpoints().

Describe alternatives you've considered I thought about implementing this by adding a dummy (noop) checkpoint after going backward, because then the forward checkpoints effectively get cleared. However, adding a checkpoint without changes does not do anything, so this does not work.

jamesgpearce commented 10 months ago

OK, I added this in https://github.com/tinyplex/tinybase/releases/tag/v4.5.3 - please give it a whirl and check it does what you expect!

jamesgpearce commented 10 months ago

Closing this out as I assume it's working!

segments-tobias commented 9 months ago

Just wanted to let you know this works perfectly. Thanks!