Interface: LiveQuery<T>
Interface: LiveQuery<T>
Section titled “Interface: LiveQuery<T>”Defined in: core/src/query/engine.ts:16
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”
readonlyast:SelectQuery
Defined in: core/src/query/engine.ts:17
Methods
Section titled “Methods”subscribe()
Section titled “subscribe()”subscribe(
observer): () =>void
Defined in: core/src/query/engine.ts:18
Parameters
Section titled “Parameters”observer
Section titled “observer”(rows) => void
Returns
Section titled “Returns”() => void
whenReady()?
Section titled “whenReady()?”
optionalwhenReady():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.
Returns
Section titled “Returns”Promise<void>
subscribeDelta()?
Section titled “subscribeDelta()?”
optionalsubscribeDelta(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).
Parameters
Section titled “Parameters”observer
Section titled “observer”(delta) => void
Returns
Section titled “Returns”() => void