LiveRowsMaterializer
Defined in: packages/client/src/worker/live-diff.ts:104
The tab-side fold of live diffs into an ordered row array with STABLE object identity (§4). The initial
snapshot seeds the cache; each diff rebuilds the array from diff.order, reusing the cached object for
any key not in added/changed (so an unchanged row keeps === and a memoized React row skips its
re-render), and installing a fresh object for added/changed keys. Order is exactly diff.order — the
query’s ORDER BY as delivered by the worker.
Type Parameters
Section titled “Type Parameters”TRow extends Record<string, unknown> = Record<string, unknown>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LiveRowsMaterializer<
TRow>(pkColumns):LiveRowsMaterializer<TRow>
Defined in: packages/client/src/worker/live-diff.ts:109
Parameters
Section titled “Parameters”pkColumns
Section titled “pkColumns”readonly string[] | undefined
Returns
Section titled “Returns”LiveRowsMaterializer<TRow>
Methods
Section titled “Methods”apply()
Section titled “apply()”apply(
diff):TRow[]
Defined in: packages/client/src/worker/live-diff.ts:126
Apply a diff; returns the new ordered array (a fresh array, but unchanged rows keep their object identity).
Parameters
Section titled “Parameters”Omit<LiveDiffPayload, "queryId">
Returns
Section titled “Returns”TRow[]
current()
Section titled “current()”current():
TRow[]
Defined in: packages/client/src/worker/live-diff.ts:137
The current ordered rows (identity-stable across apply calls for unchanged rows).
Returns
Section titled “Returns”TRow[]
seed()
Section titled “seed()”seed(
initialRows):TRow[]
Defined in: packages/client/src/worker/live-diff.ts:114
Seed from the initial snapshot; returns the initial ordered rows (each a distinct cached object).
Parameters
Section titled “Parameters”initialRows
Section titled “initialRows”readonly TRow[]
Returns
Section titled “Returns”TRow[]