- Notifications
You must be signed in to change notification settings - Fork10
Description
Instead of a true offline-first paradigm, you can already leave out the pull option in order to only push updates to Supabase without ever fetching any data from Supabase. So you could use the SupabaseClient directly to fetch, and then use rxdb-supabase only to queue changes (possibly while offline) and then push them to Supabase when back online.
This path is currently untested, and because your RxDB is basically empty except for changes, this will always invoke the conflict handler, so you'll have to provide your own for this to work and you don't get the nice conflict resolution. A better way for this to work would be to first add every row you want to update to the RxDBvia the pull handler. This wouldn't actually be hard to support via thestream$
interface.
So when you want to do a change in push-only mode, you'd want to:
- Call a new method on SupabaseReplication to add theprevious state of the document to RxDB
- Wait for that sync to finish
- Then use the normal RxDB methods for updating