Skip to content

Documentation / @super-line/react / useLiveQuery

Function: useLiveQuery()

useLiveQuery<Row>(make, deps): LiveQueryState<Row>

Defined in: index.ts:71

The context-free glue between a LiveRowSet and React — the ~20 lines every consumer of the raw client surface used to hand-write. make builds the set (return it; the hook owns its lifecycle and closes it on unmount or when deps change); pass null for the idle state. make itself is deliberately NOT a dependency — an inline arrow is safe; re-subscription is driven by deps alone.

Type Parameters

Row

Row

Parameters

make

(() => LiveRowSet<Row>) | null

deps

readonly unknown[]

Returns

LiveQueryState<Row>

Released under the MIT License.