tinybase icon indicating copy to clipboard operation
tinybase copied to clipboard

Extra persister events (start + finish)

Open segments-tobias opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

  • There's currently no way to let users know when their data is done being persisted when auto-saving.
  • We currently cannot get a precise timestamp of the last save.

Describe the solution you'd like As suggested by @rob-gordon on Discord, it'd be nice to be able to subscribe to persister events, such as startAutoSave, finishedAutoSave, and potentially the same for auto-loading.

Describe alternatives you've considered For the timestamp problem, I've added a listener on the checkpoints, which is granular enough for my use case.

segments-tobias avatar May 02 '24 08:05 segments-tobias

OK I like this. In the middle of a few other things but let's see...

jamesgpearce avatar May 15 '24 18:05 jamesgpearce

OK, this API is going to land soon:

image

There will also be hooks and <Provider /> support so this state can be tracked in a UI. Hoping this works for you!

jamesgpearce avatar Sep 10 '24 21:09 jamesgpearce

OK, this is shipped in 5.3.0-beta.3. Take a look at the new methods, listeners and hooks, and see if it does what you need!

jamesgpearce avatar Sep 12 '24 21:09 jamesgpearce