Sync / foldkit-sync
foldkit-sync
Local-first replication for part of a Foldkit application.
You name a slice of the Model that several devices share, and the existing
Messages that change it. From then on an edit applies at once, is saved in a
local outbox, reaches the server when the network allows, and lands in the same
order on every device. Nothing about the application changes shape: Model,
Message, and update stay the one state machine. Sync wraps them; it never
adds a second reducer.
A durable Message is one of your existing Messages, recorded. It still runs through your
update. Sync adds the outbox, the optimistic view, the exchange with the server, and the rebase when the server's answer arrives.
It is the client half of replicated Foldkit state.
foldkit-durable is the server half, an ordered journal on
SQLite. Either works without the other.