Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

UseConditionalLiveQueryResult.md

117 lines2.0 KB

1---
2id: UseConditionalLiveQueryResult
3title: UseConditionalLiveQueryResult
4---
5​
6Defined in: [useLiveQuery.ts:98](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L98)
7​
8The result of a live query whose callback can disable it.
9​
10## Extends
11​
12- `LiveQueryResultFlags`
13​
14## Type Parameters
15​
16### TResult
17​
18`TResult` *extends* `object`
19​
20### TKey
21​
22`TKey` *extends* `string` \| `number`
23​
24### TData
25​
26`TData`
27​
28### TCollection
29​
30`TCollection`
31​
32## Properties
33​
34### collection
35​
36```ts
37collection: TCollection | undefined;
38```
39​
40Defined in: [useLiveQuery.ts:106](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L106)
41​
42***
43​
44### data
45​
46```ts
47data: TData | undefined;
48```
49​
50Defined in: [useLiveQuery.ts:105](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L105)
51​
52***
53​
54### health
55​
56```ts
57health: HealthNode | undefined;
58```
59​
60Defined in: [useLiveQuery.ts:80](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L80)
61​
62The health tree for the query and every Collection it depends on, or
63`undefined` for a disabled query.
64​
65#### Inherited from
66​
67```ts
68LiveQueryResultFlags.health
69```
70​
71***
72​
73### isEnabled
74​
75```ts
76isEnabled: boolean;
77```
78​
79Defined in: [useLiveQuery.ts:108](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L108)
80​
81***
82​
83### isSyncError
84​
85```ts
86isSyncError: boolean;
87```
88​
89Defined in: [useLiveQuery.ts:75](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L75)
90​
91The data is shown, and a sync problem or failed request is in `health`.
92​
93#### Inherited from
94​
95```ts
96LiveQueryResultFlags.isSyncError
97```
98​
99***
100​
101### state
102​
103```ts
104state: ReadonlyMap<TKey, TResult> | undefined;
105```
106​
107Defined in: [useLiveQuery.ts:104](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L104)
108​
109***
110​
111### status
112​
113```ts
114status: UseLiveQueryStatus;
115```
116​
117Defined in: [useLiveQuery.ts:107](https://github.com/TanStack/db/blob/main/packages/preact-db/src/useLiveQuery.ts#L107)