MCPcopy Create free account
hub / github.com/editablejs/editable / updateSubDocHandler

Function updateSubDocHandler

packages/yjs-websocket/src/server/utils.ts:41–53  ·  view source on GitHub ↗
(
  subId: string,
  update: Uint8Array,
  origin: string,
  doc: WSSharedDocInterface,
)

Source from the content-addressed store, hash-verified

39}
40
41const updateSubDocHandler = (
42 subId: string,
43 update: Uint8Array,
44 origin: string,
45 doc: WSSharedDocInterface,
46) => {
47 const encoder = encoding.createEncoder()
48 encoding.writeVarUint(encoder, messageSubDocSync)
49 encoding.writeVarString(encoder, subId)
50 syncProtocol.writeUpdate(encoder, update)
51 const message = encoding.toUint8Array(encoder)
52 doc.conns.forEach((_, conn) => send(doc, conn, message))
53}
54
55interface AwarenessChangeHandlerOptions {
56 added: number[]

Callers 1

handleSubDocUpdateMethod · 0.85

Calls 1

sendFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…