Skip to content

isLiveQueryDef

isLiveQueryDef(value): value is LiveQueryDef<any, “def”> | SignalDef<any>

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

Type guard that checks if a value is a query or signal definition.

Use this to distinguish between definitions (blueprints) and instances (live queries). Definitions are created by queryDb(), computed(), and signal().

unknown

value is LiveQueryDef<any, “def”> | SignalDef<any>

const todos$ = queryDb(tables.todos.all())
if (isLiveQueryDef(todos$)) {
console.log('This is a definition:', todos$.label)
}