Skip to content

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.

TRow extends Record<string, unknown> = Record<string, unknown>

new LiveRowsMaterializer<TRow>(pkColumns): LiveRowsMaterializer<TRow>

Defined in: packages/client/src/worker/live-diff.ts:109

readonly string[] | undefined

LiveRowsMaterializer<TRow>

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).

Omit<LiveDiffPayload, "queryId">

TRow[]


current(): TRow[]

Defined in: packages/client/src/worker/live-diff.ts:137

The current ordered rows (identity-stable across apply calls for unchanged rows).

TRow[]


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).

readonly TRow[]

TRow[]