tinyplex / tinybase

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

Extra persister events (start + finish) #145

Open segments-tobias opened 5 months ago

segments-tobias commented 5 months ago

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

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.

jamesgpearce commented 4 months ago

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

jamesgpearce commented 3 weeks ago

OK, this API is going to land soon:

image

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

jamesgpearce commented 2 weeks ago

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!