API reference · generated from source
Interface: IStateReconciler<TState>#
Defined in: retree-convex/src/types.ts:322
Reconciles an incoming query value against the current node state.
Type Parameters#
| Type Parameter |
|---|
TState |
Methods#
reconcile()#
reconcile(
current,
next,
rawCurrent?): TState;Defined in: retree-convex/src/types.ts:340
Reconcile next into current.
Parameters#
| Parameter | Type | Description |
|---|---|---|
current | TState | undefined | Current query state, if any. Write surface. |
next | TState | Newly emitted query state (raw server data). |
rawCurrent? | TState | Raw view of current for fast reads; undefined when current is undefined or not object-valued. |
Returns#
TState
The state object that should be assigned to the query node.
Remarks#
Reconciliation is read-dominated: it compares every field and writes
only the diffs. Read from rawCurrent, write to current.
rawCurrent is the raw object behind current (Retree.raw) —
native-speed, proxy-free reads. Writes must go through current so
changed rows emit nodeChanged and item identity stays stable for
useNode rows; writes to rawCurrent skip emission entirely.