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

InjectLiveQueryResult.md

128 lines2.7 KB

1---
2id: InjectLiveQueryResult
3title: InjectLiveQueryResult
4---
5​
6# Interface: InjectLiveQueryResult\<TContext\>
7​
8Defined in: [index.ts:32](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L32)
9​
10The result of calling `injectLiveQuery`.
11Contains reactive signals for the query state and data.
12​
13## Type Parameters
14​
15### TContext
16​
17`TContext` *extends* `Context`
18​
19## Properties
20​
21### collection
22​
23```ts
24collection: Signal<
25 | Collection<{ [K in string | number | symbol]: ResultValue<TContext>[K] }, string | number, {
26}, StandardSchemaV1<unknown, unknown>, { [K in string | number | symbol]: ResultValue<TContext>[K] }>
27| null>;
28```
29​
30Defined in: [index.ts:38](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L38)
31​
32A signal containing the underlying collection instance (null for disabled queries)
33​
34***
35​
36### data
37​
38```ts
39data: Signal<InferResultType<TContext>>;
40```
41​
42Defined in: [index.ts:36](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L36)
43​
44A signal containing the results as an array, or single result for findOne queries
45​
46***
47​
48### isCleanedUp
49​
50```ts
51isCleanedUp: Signal<boolean>;
52```
53​
54Defined in: [index.ts:54](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L54)
55​
56A signal indicating whether the collection has been cleaned up
57​
58***
59​
60### isError
61​
62```ts
63isError: Signal<boolean>;
64```
65​
66Defined in: [index.ts:52](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L52)
67​
68A signal indicating whether the collection has an error
69​
70***
71​
72### isIdle
73​
74```ts
75isIdle: Signal<boolean>;
76```
77​
78Defined in: [index.ts:50](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L50)
79​
80A signal indicating whether the collection is idle
81​
82***
83​
84### isLoading
85​
86```ts
87isLoading: Signal<boolean>;
88```
89​
90Defined in: [index.ts:46](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L46)
91​
92A signal indicating whether the collection is currently loading
93​
94***
95​
96### isReady
97​
98```ts
99isReady: Signal<boolean>;
100```
101​
102Defined in: [index.ts:48](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L48)
103​
104A signal indicating whether the collection is ready
105​
106***
107​
108### state
109​
110```ts
111state: Signal<Map<string | number, { [K in string | number | symbol]: ResultValue<TContext>[K] }>>;
112```
113​
114Defined in: [index.ts:34](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L34)
115​
116A signal containing the complete state map of results keyed by their ID
117​
118***
119​
120### status
121​
122```ts
123status: Signal<CollectionStatus | "disabled">;
124```
125​
126Defined in: [index.ts:44](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L44)
127​
128A signal containing the current status of the collection