fn
reconcileDoc
testedBuild a document equal to next but reusing block-node identities from prev
wherever a block is deep-equal — so applying a remote change repaints only the
blocks that actually changed (others keep their reference, and the local caret
in them is undisturbed). Returns prev unchanged when nothing differs.
Signature
ts
export function reconcileDoc(prev: WritekitDocument, next: WritekitDocument): WritekitDocument{ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
prev | WritekitDocument | — |
next | WritekitDocument | — |
Returns
WritekitDocument| Property | Type | Description |
|---|---|---|
type | 'doc' | — |
content | readonly Node[] | — |