@tanstack/solid-query 5.104.1 → 5.104.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/useQuery.ts CHANGED
@@ -17,8 +17,6 @@ import type {
17
17
  /**
18
18
  * Subscribes to a query: a declarative dependency on an asynchronous source of data that is tied to a unique key.
19
19
  * The query runs when the options call for it — `enabled: false` skips the initial fetch.
20
- *
21
- * @see {@link queryOptions} to share these options between `useQuery` and imperative APIs like `queryClient.query`.
22
20
  * @param options - An accessor returning the {@link UndefinedInitialDataOptions} to use — everything you can
23
21
  * pass to `useQuery`.
24
22
  * @param queryClient - An accessor for a custom `QueryClient`. Otherwise, the one from the nearest context
@@ -26,7 +24,7 @@ import type {
26
24
  * @returns The current query result, as a Solid store. `status` is `pending` if there is no cached data to
27
25
  * display, `error` if the last fetch attempt failed, or `success` if the query has data to display.
28
26
  * `isPending`/`isSuccess`/`isError` are derived booleans for convenience.
29
- *
27
+ * @see {@link queryOptions} to share these options between `useQuery` and imperative APIs like `queryClient.query`.
30
28
  * @example
31
29
  * ```tsx
32
30
  * import { For, Match, Switch } from 'solid-js'
@@ -52,7 +50,6 @@ import type {
52
50
  * )
53
51
  * }
54
52
  * ```
55
- *
56
53
  * @example
57
54
  * `select` derives whatever `data` a component needs from the cached value, without changing what's
58
55
  * actually stored in the cache — the cache still holds the full `Post[]`, but `data` here is a `number`:
@@ -76,7 +73,6 @@ import type {
76
73
  * )
77
74
  * }
78
75
  * ```
79
- *
80
76
  * @example
81
77
  * A dependent query, only enabled once `postId` is set:
82
78
  * ```tsx
@@ -99,7 +95,6 @@ import type {
99
95
  * )
100
96
  * }
101
97
  * ```
102
- *
103
98
  * @example
104
99
  * The same dependent query, using `skipToken` to disable it in a type-safe way instead of relying on
105
100
  * `enabled`. The non-null assertion is still needed — Solid's `props` narrowing doesn't survive into the
@@ -125,7 +120,6 @@ import type {
125
120
  * )
126
121
  * }
127
122
  * ```
128
- *
129
123
  * @example
130
124
  * Seeding a detail query from an already-cached list, to skip the loading state. `initialDataUpdatedAt` carries
131
125
  * over the list's own fetch time, so that if you set a `staleTime`, it's measured from when the list was
@@ -150,7 +144,6 @@ import type {
150
144
  * return postQuery.isError ? <span>Error: {postQuery.error.message}</span> : <h1>{postQuery.data?.title}</h1>
151
145
  * }
152
146
  * ```
153
- *
154
147
  * @example
155
148
  * Paginated data, keeping the previous page's data visible while the next page loads:
156
149
  * ```tsx
@@ -198,8 +191,6 @@ export function useQuery<
198
191
  *
199
192
  * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless
200
193
  * a `select` changes `TData` to include `undefined`).
201
- *
202
- * @see {@link queryOptions} to share these options between `useQuery` and imperative APIs like `queryClient.query`.
203
194
  * @param options - An accessor returning the {@link DefinedInitialDataOptions} to use — everything you can
204
195
  * pass to `useQuery`, with `initialData` set.
205
196
  * @param queryClient - An accessor for a custom `QueryClient`. Otherwise, the one from the nearest context
@@ -208,7 +199,7 @@ export function useQuery<
208
199
  * fetch attempt fails while keeping the existing data (`status` never resolves to `pending` in this overload's
209
200
  * type, since `initialData` guarantees data upfront). `isSuccess`/`isError` are derived booleans for
210
201
  * convenience.
211
- *
202
+ * @see {@link queryOptions} to share these options between `useQuery` and imperative APIs like `queryClient.query`.
212
203
  * @example
213
204
  * ```tsx
214
205
  * import { For } from 'solid-js'