Documentation
¶
Overview ¶
Command offline-first demonstrates the ygo client's offline-first persistence. With a LocalStore the document loads from disk before any network, stays editable with no server reachable, and carries offline edits up to the server on the next successful connect.
Run it repeatedly against the same -store to watch the log persist across restarts with no server at all:
go run ./examples/offline-first -store notes.db -add "first note" go run ./examples/offline-first -store notes.db -add "second note" go run ./examples/offline-first -store notes.db # lists both
Point -url at a live ygo/y-websocket server and the accumulated offline edits sync up on connect (the handshake carries the local state).
Click to show internal directories.
Click to hide internal directories.