MCPcopy
hub / github.com/tldraw/tldraw / documentScopeDiff

Function documentScopeDiff

packages/sync-core/src/lib/TLSyncClient.test.ts:204–210  ·  view source on GitHub ↗

* A server diff that mirrors the store's current document records. Using this as the default * connect diff means a wipe_all hydration round-trips to no change, keeping the tldraw schema's * integrity checker quiet (it would otherwise recreate the document/page records as new local * changes).

()

Source from the content-addressed store, hash-verified

202 * changes).
203 */
204 function documentScopeDiff(): NetworkDiff<TestRecord> {
205 const diff: NetworkDiff<TestRecord> = {}
206 for (const [id, record] of Object.entries(store.serialize('document'))) {
207 diff[id] = [RecordOpType.Put, record as TestRecord]
208 }
209 return diff
210 }
211
212 function createConnectMessage(
213 overrides: Partial<Extract<TLSocketServerSentEvent<TestRecord>, { type: 'connect' }>> = {}

Callers 1

createConnectMessageFunction · 0.85

Calls 2

entriesMethod · 0.65
serializeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…