Skip to main content
Module

x/automerge/index.ts>generateSyncMessage

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
Go to Latest
function generateSyncMessage
import { generateSyncMessage } from "https://deno.land/x/automerge@2.2.0/index.ts";

Generate a sync message to send to the peer represented by inState

Parameters

doc: Doc<T>
  • The doc to generate messages about
inState: SyncState
  • The SyncState representing the peer we are talking to

Returns

An array of [newSyncState, syncMessage | null] where newSyncState should replace inState and syncMessage should be sent to the peer if it is not null. If syncMessage is null then we are up to date.