Skip to content

Commit 9dba1c1

Browse files
docs: regenerate API documentation (#969)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent c6ea254 commit 9dba1c1

File tree

9 files changed

+378
-42
lines changed

9 files changed

+378
-42
lines changed

docs/framework/angular/reference/functions/injectLiveQuery.md

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Defined in: [index.ts:51](https://github.com/TanStack/db/blob/main/packages/angu
4242
## Call Signature
4343

4444
```ts
45-
function injectLiveQuery<TContext>(queryFn): InjectLiveQueryResult<{ [K in string | number | symbol]: (TContext["result"] extends object ? any[any] : TContext["hasJoins"] extends true ? TContext["schema"] : TContext["schema"][TContext["fromSourceName"]])[K] }>;
45+
function injectLiveQuery<TContext, TParams>(options): InjectLiveQueryResult<{ [K in string | number | symbol]: (TContext["result"] extends object ? any[any] : TContext["hasJoins"] extends true ? TContext["schema"] : TContext["schema"][TContext["fromSourceName"]])[K] }>;
4646
```
4747

4848
Defined in: [index.ts:61](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L61)
@@ -53,6 +53,40 @@ Defined in: [index.ts:61](https://github.com/TanStack/db/blob/main/packages/angu
5353

5454
`TContext` *extends* `Context`
5555

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)\<\{ \[K in string \| number \| symbol\]: (TContext\["result"\] extends object ? any\[any\] : TContext\["hasJoins"\] extends true ? TContext\["schema"\] : TContext\["schema"\]\[TContext\["fromSourceName"\]\])\[K\] \}\>
75+
76+
## Call Signature
77+
78+
```ts
79+
function injectLiveQuery<TContext>(queryFn): InjectLiveQueryResult<{ [K in string | number | symbol]: (TContext["result"] extends object ? any[any] : TContext["hasJoins"] extends true ? TContext["schema"] : TContext["schema"][TContext["fromSourceName"]])[K] }>;
80+
```
81+
82+
Defined in: [index.ts:71](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L71)
83+
84+
### Type Parameters
85+
86+
#### TContext
87+
88+
`TContext` *extends* `Context`
89+
5690
### Parameters
5791

5892
#### queryFn
@@ -65,11 +99,35 @@ Defined in: [index.ts:61](https://github.com/TanStack/db/blob/main/packages/angu
6599

66100
## Call Signature
67101

102+
```ts
103+
function injectLiveQuery<TContext>(queryFn): InjectLiveQueryResult<{ [K in string | number | symbol]: (TContext["result"] extends object ? any[any] : TContext["hasJoins"] extends true ? TContext["schema"] : TContext["schema"][TContext["fromSourceName"]])[K] }>;
104+
```
105+
106+
Defined in: [index.ts:74](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L74)
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)\<\{ \[K in string \| number \| symbol\]: (TContext\["result"\] extends object ? any\[any\] : TContext\["hasJoins"\] extends true ? TContext\["schema"\] : TContext\["schema"\]\[TContext\["fromSourceName"\]\])\[K\] \}\>
123+
124+
## Call Signature
125+
68126
```ts
69127
function injectLiveQuery<TContext>(config): InjectLiveQueryResult<{ [K in string | number | symbol]: (TContext["result"] extends object ? any[any] : TContext["hasJoins"] extends true ? TContext["schema"] : TContext["schema"][TContext["fromSourceName"]])[K] }>;
70128
```
71129

72-
Defined in: [index.ts:64](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L64)
130+
Defined in: [index.ts:77](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L77)
73131

74132
### Type Parameters
75133

@@ -93,7 +151,7 @@ Defined in: [index.ts:64](https://github.com/TanStack/db/blob/main/packages/angu
93151
function injectLiveQuery<TResult, TKey, TUtils>(liveQueryCollection): InjectLiveQueryResult<TResult, TKey, TUtils>;
94152
```
95153

96-
Defined in: [index.ts:67](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L67)
154+
Defined in: [index.ts:80](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L80)
97155

98156
### Type Parameters
99157

docs/framework/angular/reference/interfaces/InjectLiveQueryResult.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ Contains reactive signals for the query state and data.
3030
### collection
3131

3232
```ts
33-
collection: Signal<Collection<TResult, TKey, TUtils, StandardSchemaV1<unknown, unknown>, TResult>>;
33+
collection: Signal<
34+
| Collection<TResult, TKey, TUtils, StandardSchemaV1<unknown, unknown>, TResult>
35+
| null>;
3436
```
3537

3638
Defined in: [index.ts:36](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L36)
3739

38-
A signal containing the underlying collection instance
40+
A signal containing the underlying collection instance (null for disabled queries)
3941

4042
***
4143

@@ -126,7 +128,7 @@ A signal containing the complete state map of results keyed by their ID
126128
### status
127129

128130
```ts
129-
status: Signal<CollectionStatus>;
131+
status: Signal<CollectionStatus | "disabled">;
130132
```
131133

132134
Defined in: [index.ts:38](https://github.com/TanStack/db/blob/main/packages/angular-db/src/index.ts#L38)

docs/framework/solid/reference/functions/useLiveQuery.md

Lines changed: 147 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ title: useLiveQuery
1111
function useLiveQuery<TContext>(queryFn): object;
1212
```
1313

14-
Defined in: [useLiveQuery.ts:80](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L80)
14+
Defined in: [useLiveQuery.ts:84](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L84)
1515

1616
Create a live query using a query function
1717

@@ -149,11 +149,155 @@ return (
149149

150150
## Call Signature
151151

152+
```ts
153+
function useLiveQuery<TContext>(queryFn): object;
154+
```
155+
156+
Defined in: [useLiveQuery.ts:99](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L99)
157+
158+
Create a live query using a query function
159+
160+
### Type Parameters
161+
162+
#### TContext
163+
164+
`TContext` *extends* `Context`
165+
166+
### Parameters
167+
168+
#### queryFn
169+
170+
(`q`) => `QueryBuilder`\<`TContext`\> \| `null` \| `undefined`
171+
172+
Query function that defines what data to fetch
173+
174+
### Returns
175+
176+
`object`
177+
178+
Object with reactive data, state, and status information
179+
180+
#### collection
181+
182+
```ts
183+
collection: Accessor<
184+
| Collection<{ [K in string | number | symbol]: (TContext["result"] extends object ? any[any] : TContext["hasJoins"] extends true ? TContext["schema"] : TContext["schema"][TContext["fromSourceName"]])[K] }, string | number, {
185+
}, StandardSchemaV1<unknown, unknown>, { [K in string | number | symbol]: (TContext["result"] extends object ? any[any] : TContext["hasJoins"] extends true ? TContext["schema"] : TContext["schema"][TContext["fromSourceName"]])[K] }>
186+
| null>;
187+
```
188+
189+
#### data
190+
191+
```ts
192+
data: { [K in string | number | symbol]: (TContext["result"] extends object ? any[any] : TContext["hasJoins"] extends true ? TContext["schema"] : TContext["schema"][TContext["fromSourceName"]])[K] }[];
193+
```
194+
195+
#### isCleanedUp
196+
197+
```ts
198+
isCleanedUp: Accessor<boolean>;
199+
```
200+
201+
#### isError
202+
203+
```ts
204+
isError: Accessor<boolean>;
205+
```
206+
207+
#### isIdle
208+
209+
```ts
210+
isIdle: Accessor<boolean>;
211+
```
212+
213+
#### isLoading
214+
215+
```ts
216+
isLoading: Accessor<boolean>;
217+
```
218+
219+
#### isReady
220+
221+
```ts
222+
isReady: Accessor<boolean>;
223+
```
224+
225+
#### state
226+
227+
```ts
228+
state: ReactiveMap<string | number, { [K in string | number | symbol]: (TContext["result"] extends object ? any[any] : TContext["hasJoins"] extends true ? TContext["schema"] : TContext["schema"][TContext["fromSourceName"]])[K] }>;
229+
```
230+
231+
#### status
232+
233+
```ts
234+
status: Accessor<CollectionStatus | "disabled">;
235+
```
236+
237+
### Examples
238+
239+
```ts
240+
// Basic query with object syntax
241+
const todosQuery = useLiveQuery((q) =>
242+
q.from({ todos: todosCollection })
243+
.where(({ todos }) => eq(todos.completed, false))
244+
.select(({ todos }) => ({ id: todos.id, text: todos.text }))
245+
)
246+
```
247+
248+
```ts
249+
// With dependencies that trigger re-execution
250+
const todosQuery = useLiveQuery(
251+
(q) => q.from({ todos: todosCollection })
252+
.where(({ todos }) => gt(todos.priority, minPriority())),
253+
)
254+
```
255+
256+
```ts
257+
// Join pattern
258+
const personIssues = useLiveQuery((q) =>
259+
q.from({ issues: issueCollection })
260+
.join({ persons: personCollection }, ({ issues, persons }) =>
261+
eq(issues.userId, persons.id)
262+
)
263+
.select(({ issues, persons }) => ({
264+
id: issues.id,
265+
title: issues.title,
266+
userName: persons.name
267+
}))
268+
)
269+
```
270+
271+
```ts
272+
// Handle loading and error states
273+
const todosQuery = useLiveQuery((q) =>
274+
q.from({ todos: todoCollection })
275+
)
276+
277+
return (
278+
<Switch>
279+
<Match when={todosQuery.isLoading()}>
280+
<div>Loading...</div>
281+
</Match>
282+
<Match when={todosQuery.isError()}>
283+
<div>Error: {todosQuery.status()}</div>
284+
</Match>
285+
<Match when={todosQuery.isReady()}>
286+
<For each={todosQuery.data()}>
287+
{(todo) => <li key={todo.id}>{todo.text}</li>}
288+
</For>
289+
</Match>
290+
</Switch>
291+
)
292+
```
293+
294+
## Call Signature
295+
152296
```ts
153297
function useLiveQuery<TContext>(config): object;
154298
```
155299

156-
Defined in: [useLiveQuery.ts:135](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L135)
300+
Defined in: [useLiveQuery.ts:158](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L158)
157301

158302
Create a live query using configuration object
159303

@@ -279,7 +423,7 @@ return (
279423
function useLiveQuery<TResult, TKey, TUtils>(liveQueryCollection): object;
280424
```
281425

282-
Defined in: [useLiveQuery.ts:185](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L185)
426+
Defined in: [useLiveQuery.ts:208](https://github.com/TanStack/db/blob/main/packages/solid-db/src/useLiveQuery.ts#L208)
283427

284428
Subscribe to an existing live query collection
285429

0 commit comments

Comments
 (0)