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

injectLiveQuery.md

210 lines4.0 KB

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