@mocanvas/sync · function

createSyncClient

declare function createSyncClient<R extends UnknownRecord = UnknownRecord>(options: SyncClientOptions<R>): SyncClient

Joins one room over transport and keeps store in step with its peers.

Document changes made locally by the user are stamped by the CRDT (see crdt.ts) and broadcast; incoming messages are merged field by field and only the fields that won are applied, as remote changes, so they neither echo back nor land in the undo stack. Concurrent edits to different fields of one record all survive, and replicas converge whatever order messages arrive in.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.