Open History to see the last commit
1---
2id: injectLiveQuery
3title: injectLiveQuery
4---
5
6## Call Signature
7
8```ts
9function injectLiveQuery<TContext, TParams>(options): InjectLiveQueryResult<TContext>;
10```
11
12Defined in: [angular-db/src/index.ts:121](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L121)
13
14### Type Parameters
15
16#### TContext
17
18`TContext` *extends* `Context`
19
20#### TParams
21
22`TParams` *extends* `unknown`
23
24### Parameters
25
26#### options
27
28##### params
29
30() => `TParams`
31
32##### pool?
33
34\{
35\}
36
37Pass `pooledLiveQueries` to share one partition among equal-shape queries.
38
39##### query
40
41(`args`) => `QueryBuilder`\<`TContext`\>
42
43### Returns
44
45[`InjectLiveQueryResult`](../interfaces/InjectLiveQueryResult.md)\<`TContext`\>
46
47## Call Signature
48
49```ts
50function injectLiveQuery<TContext, TParams>(options): InjectConditionalLiveQueryResult<TContext>;
51```
52
53Defined in: [angular-db/src/index.ts:133](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L133)
54
55### Type Parameters
56
57#### TContext
58
59`TContext` *extends* `Context`
60
61#### TParams
62
63`TParams` *extends* `unknown`
64
65### Parameters
66
67#### options
68
69##### params
70
71() => `TParams`
72
73##### pool?
74
75\{
76\}
77
78Pass `pooledLiveQueries` to share one partition among equal-shape queries.
79
80##### query
81
82(`args`) => `QueryBuilder`\<`TContext`\> \| `null` \| `undefined`
83
84### Returns
85
86[`InjectConditionalLiveQueryResult`](../type-aliases/InjectConditionalLiveQueryResult.md)\<`TContext`\>
87
88## Call Signature
89
90```ts
91function injectLiveQuery<TContext>(queryFn): InjectLiveQueryResult<TContext>;
92```
93
94Defined in: [angular-db/src/index.ts:145](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L145)
95
96### Type Parameters
97
98#### TContext
99
100`TContext` *extends* `Context`
101
102### Parameters
103
104#### queryFn
105
106(`q`) => `QueryBuilder`\<`TContext`\>
107
108### Returns
109
110[`InjectLiveQueryResult`](../interfaces/InjectLiveQueryResult.md)\<`TContext`\>
111
112## Call Signature
113
114```ts
115function injectLiveQuery<TContext>(queryFn): InjectConditionalLiveQueryResult<TContext>;
116```
117
118Defined in: [angular-db/src/index.ts:148](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L148)
119
120### Type Parameters
121
122#### TContext
123
124`TContext` *extends* `Context`
125
126### Parameters
127
128#### queryFn
129
130(`q`) => `QueryBuilder`\<`TContext`\> \| `null` \| `undefined`
131
132### Returns
133
134[`InjectConditionalLiveQueryResult`](../type-aliases/InjectConditionalLiveQueryResult.md)\<`TContext`\>
135
136## Call Signature
137
138```ts
139function injectLiveQuery<TContext>(config): InjectLiveQueryResult<TContext>;
140```
141
142Defined in: [angular-db/src/index.ts:153](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L153)
143
144### Type Parameters
145
146#### TContext
147
148`TContext` *extends* `Context`
149
150### Parameters
151
152#### config
153
154`LiveQueryHookConfig`\<`TContext`\>
155
156### Returns
157
158[`InjectLiveQueryResult`](../interfaces/InjectLiveQueryResult.md)\<`TContext`\>
159
160## Call Signature
161
162```ts
163function injectLiveQuery<TResult, TKey, TUtils>(liveQueryCollection): InjectLiveQueryResultWithCollection<TResult, TKey, TUtils>;
164```
165
166Defined in: [angular-db/src/index.ts:157](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L157)
167
168### Type Parameters
169
170#### TResult
171
172`TResult` *extends* `object`
173
174#### TKey
175
176`TKey` *extends* `string` \| `number`
177
178#### TUtils
179
180`TUtils` *extends* `Record`\<`string`, `any`\>
181
182### Parameters
183
184#### liveQueryCollection
185
186`Collection`\<`TResult`, `TKey`, `TUtils`, `StandardSchemaV1`\<`unknown`, `unknown`\>, `TResult`\> & `NonSingleResult`
187
188### Returns
189
190[`InjectLiveQueryResultWithCollection`](../interfaces/InjectLiveQueryResultWithCollection.md)\<`TResult`, `TKey`, `TUtils`\>
191
192## Call Signature
193
194```ts
195function injectLiveQuery<TResult, TKey, TUtils>(liveQueryCollection): InjectLiveQueryResultWithSingleResultCollection<TResult, TKey, TUtils>;
196```
197
198Defined in: [angular-db/src/index.ts:165](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L165)
199
200### Type Parameters
201
202#### TResult
203
204`TResult` *extends* `object`
205
206#### TKey
207
208`TKey` *extends* `string` \| `number`
209
210#### TUtils
211
212`TUtils` *extends* `Record`\<`string`, `any`\>
213
214### Parameters
215
216#### liveQueryCollection
217
218`Collection`\<`TResult`, `TKey`, `TUtils`, `StandardSchemaV1`\<`unknown`, `unknown`\>, `TResult`\> & `SingleResult`
219
220### Returns
221
222[`InjectLiveQueryResultWithSingleResultCollection`](../interfaces/InjectLiveQueryResultWithSingleResultCollection.md)\<`TResult`, `TKey`, `TUtils`\>