Skip to content

Interface: LiveQuery<T>

Defined in: core/src/query/engine.ts:16

T

readonly ast: SelectQuery

Defined in: core/src/query/engine.ts:17

subscribe(observer): () => void

Defined in: core/src/query/engine.ts:18

(rows) => void

() => void


optional whenReady(): Promise<void>

Defined in: core/src/query/engine.ts:28

Await the query’s first snapshot delivery. Client IVM sets up asynchronously (reads seed rows from IDB) so subscribe(cb) returns before cb has fired. Tests and other consumers that need to observe the first snapshot deterministically (rather than sleeping and hoping) can await live.whenReady() before asserting. Optional so a synchronous backend can omit the property entirely.

Promise<void>


optional subscribeDelta(observer): () => void

Defined in: core/src/query/engine.ts:42

Subscribe to O(delta) change events instead of full snapshots. Each callback receives { added, removed, changed } for row-level diff — reactive UIs (React, Solid, RxJS) can update per-row rather than diffing the whole snapshot.

Optional on the interface because non-IVM backends (server DBs, fallback re-run) can’t produce a diff without recomputing; only the client IVM path guarantees it. The row shape T matches subscribe’s snapshot rows exactly. When available, first delivery reports the current window as added (mirrors subscribe’s initial snapshot).

(delta) => void

() => void