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

injectLiveQuery.md

208 lines4.0 KB

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