Re:Show HN: ElectricSQL, Postgres to SQLite active-active sy...
by thruflo on Wednesday September 20, 2023 @04:30PM
(#37589744)
Interesting, I don’t know enough about MobX to be sure but yes, you can use the notifier to subscribe to data change notifications and query to get the changed rows.
We’d definitely be interested in chatting through the reactivity model you use if you’d be up for it.
We currently use Hasura subscriptions to pull data to the frontend (effectively select * from table where account_id = X and updated > recently). We then funnel changed rows into mobx objects so we have a lovely object graph to work with.
I’m imagining doing the same with electric so I guess you’d use notify to hear that there has been a change, then figure out if it’s in a table you care about and then select the updated records from that to merge into mobx?
Basing that off what I see in here: https://github.com/electric-sql/electric/blob/main/clients/t...