@mocanvas/sync · function

stampedDiffFromSnapshot

declare function stampedDiffFromSnapshot<R extends UnknownRecord>(records: readonly R[], state: CrdtState): StampedDiff<R>

Turn a peer's snapshot into a message the ordinary merge can eat: its records supply the values, its state supplies the stamps. Paths the state says nothing about are not claimed, so a snapshot can never overwrite a field the receiver has a stamp for.

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.