Skip to content

isLiveQueryInstance

isLiveQueryInstance(value): value is LiveQuery<any>

Defined in: packages/@livestore/livestore/src/store/store-types.ts:384

Type guard that checks if a value is a live query instance.

Live query instances are stateful objects bound to a Store’s reactivity graph. They’re created internally when you use a definition with store.query() or store.subscribe().

unknown

value is LiveQuery<any>

const [, , , query$] = useClientDocument(tables.uiState)
if (isLiveQueryInstance(query$)) {
console.log('Execution count:', query$.runs)
}