@tanstack/preact-query 5.105.0 → 5.105.1

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.
Files changed (306) hide show
  1. package/build/legacy/HydrationBoundary.cjs +1 -2
  2. package/build/legacy/HydrationBoundary.d.cts +0 -2
  3. package/build/legacy/HydrationBoundary.d.cts.map +1 -1
  4. package/build/legacy/HydrationBoundary.d.ts +0 -2
  5. package/build/legacy/HydrationBoundary.d.ts.map +1 -1
  6. package/build/legacy/HydrationBoundary.js +1 -2
  7. package/build/legacy/IsRestoringProvider.cjs +1 -2
  8. package/build/legacy/IsRestoringProvider.d.cts +0 -2
  9. package/build/legacy/IsRestoringProvider.d.cts.map +1 -1
  10. package/build/legacy/IsRestoringProvider.d.ts +0 -2
  11. package/build/legacy/IsRestoringProvider.d.ts.map +1 -1
  12. package/build/legacy/IsRestoringProvider.js +1 -2
  13. package/build/legacy/QueryClientProvider.cjs +1 -2
  14. package/build/legacy/QueryClientProvider.d.cts +0 -2
  15. package/build/legacy/QueryClientProvider.d.cts.map +1 -1
  16. package/build/legacy/QueryClientProvider.d.ts +0 -2
  17. package/build/legacy/QueryClientProvider.d.ts.map +1 -1
  18. package/build/legacy/QueryClientProvider.js +1 -2
  19. package/build/legacy/QueryErrorResetBoundary.cjs +1 -2
  20. package/build/legacy/QueryErrorResetBoundary.d.cts +0 -2
  21. package/build/legacy/QueryErrorResetBoundary.d.cts.map +1 -1
  22. package/build/legacy/QueryErrorResetBoundary.d.ts +0 -2
  23. package/build/legacy/QueryErrorResetBoundary.d.ts.map +1 -1
  24. package/build/legacy/QueryErrorResetBoundary.js +1 -2
  25. package/build/legacy/errorBoundaryUtils.cjs +1 -2
  26. package/build/legacy/errorBoundaryUtils.d.cts +0 -2
  27. package/build/legacy/errorBoundaryUtils.d.cts.map +1 -1
  28. package/build/legacy/errorBoundaryUtils.d.ts +0 -2
  29. package/build/legacy/errorBoundaryUtils.d.ts.map +1 -1
  30. package/build/legacy/errorBoundaryUtils.js +1 -2
  31. package/build/legacy/index.cjs +1 -2
  32. package/build/legacy/index.js +1 -2
  33. package/build/legacy/infiniteQueryOptions.cjs +1 -2
  34. package/build/legacy/infiniteQueryOptions.cjs.map +1 -1
  35. package/build/legacy/infiniteQueryOptions.d.cts +16 -16
  36. package/build/legacy/infiniteQueryOptions.d.cts.map +1 -1
  37. package/build/legacy/infiniteQueryOptions.d.ts +16 -16
  38. package/build/legacy/infiniteQueryOptions.d.ts.map +1 -1
  39. package/build/legacy/infiniteQueryOptions.js +1 -2
  40. package/build/legacy/infiniteQueryOptions.js.map +1 -1
  41. package/build/legacy/mutationOptions.cjs +1 -2
  42. package/build/legacy/mutationOptions.d.cts +0 -2
  43. package/build/legacy/mutationOptions.d.cts.map +1 -1
  44. package/build/legacy/mutationOptions.d.ts +0 -2
  45. package/build/legacy/mutationOptions.d.ts.map +1 -1
  46. package/build/legacy/mutationOptions.js +1 -2
  47. package/build/legacy/queryOptions.cjs +1 -2
  48. package/build/legacy/queryOptions.cjs.map +1 -1
  49. package/build/legacy/queryOptions.d.cts +16 -15
  50. package/build/legacy/queryOptions.d.cts.map +1 -1
  51. package/build/legacy/queryOptions.d.ts +16 -15
  52. package/build/legacy/queryOptions.d.ts.map +1 -1
  53. package/build/legacy/queryOptions.js +1 -2
  54. package/build/legacy/queryOptions.js.map +1 -1
  55. package/build/legacy/suspense.cjs +1 -2
  56. package/build/legacy/suspense.d.cts +0 -2
  57. package/build/legacy/suspense.d.cts.map +1 -1
  58. package/build/legacy/suspense.d.ts +0 -2
  59. package/build/legacy/suspense.d.ts.map +1 -1
  60. package/build/legacy/suspense.js +1 -2
  61. package/build/legacy/types.cjs +1 -2
  62. package/build/legacy/types.d.cts +0 -2
  63. package/build/legacy/types.d.cts.map +1 -1
  64. package/build/legacy/types.d.ts +0 -2
  65. package/build/legacy/types.d.ts.map +1 -1
  66. package/build/legacy/types.js +1 -2
  67. package/build/legacy/useBaseQuery.cjs +1 -2
  68. package/build/legacy/useBaseQuery.d.cts +0 -2
  69. package/build/legacy/useBaseQuery.d.cts.map +1 -1
  70. package/build/legacy/useBaseQuery.d.ts +0 -2
  71. package/build/legacy/useBaseQuery.d.ts.map +1 -1
  72. package/build/legacy/useBaseQuery.js +1 -2
  73. package/build/legacy/useInfiniteQuery.cjs +1 -2
  74. package/build/legacy/useInfiniteQuery.cjs.map +1 -1
  75. package/build/legacy/useInfiniteQuery.d.cts +2 -4
  76. package/build/legacy/useInfiniteQuery.d.cts.map +1 -1
  77. package/build/legacy/useInfiniteQuery.d.ts +2 -4
  78. package/build/legacy/useInfiniteQuery.d.ts.map +1 -1
  79. package/build/legacy/useInfiniteQuery.js +1 -2
  80. package/build/legacy/useInfiniteQuery.js.map +1 -1
  81. package/build/legacy/useIsFetching.cjs +1 -2
  82. package/build/legacy/useIsFetching.cjs.map +1 -1
  83. package/build/legacy/useIsFetching.d.cts +1 -3
  84. package/build/legacy/useIsFetching.d.cts.map +1 -1
  85. package/build/legacy/useIsFetching.d.ts +1 -3
  86. package/build/legacy/useIsFetching.d.ts.map +1 -1
  87. package/build/legacy/useIsFetching.js +1 -2
  88. package/build/legacy/useIsFetching.js.map +1 -1
  89. package/build/legacy/useMutation.cjs +1 -2
  90. package/build/legacy/useMutation.d.cts +0 -2
  91. package/build/legacy/useMutation.d.cts.map +1 -1
  92. package/build/legacy/useMutation.d.ts +0 -2
  93. package/build/legacy/useMutation.d.ts.map +1 -1
  94. package/build/legacy/useMutation.js +1 -2
  95. package/build/legacy/useMutationState.cjs +1 -2
  96. package/build/legacy/useMutationState.d.cts +0 -2
  97. package/build/legacy/useMutationState.d.cts.map +1 -1
  98. package/build/legacy/useMutationState.d.ts +0 -2
  99. package/build/legacy/useMutationState.d.ts.map +1 -1
  100. package/build/legacy/useMutationState.js +1 -2
  101. package/build/legacy/usePrefetchInfiniteQuery.cjs +1 -2
  102. package/build/legacy/usePrefetchInfiniteQuery.d.cts +0 -2
  103. package/build/legacy/usePrefetchInfiniteQuery.d.cts.map +1 -1
  104. package/build/legacy/usePrefetchInfiniteQuery.d.ts +0 -2
  105. package/build/legacy/usePrefetchInfiniteQuery.d.ts.map +1 -1
  106. package/build/legacy/usePrefetchInfiniteQuery.js +1 -2
  107. package/build/legacy/usePrefetchQuery.cjs +1 -2
  108. package/build/legacy/usePrefetchQuery.d.cts +0 -2
  109. package/build/legacy/usePrefetchQuery.d.cts.map +1 -1
  110. package/build/legacy/usePrefetchQuery.d.ts +0 -2
  111. package/build/legacy/usePrefetchQuery.d.ts.map +1 -1
  112. package/build/legacy/usePrefetchQuery.js +1 -2
  113. package/build/legacy/useQueries.cjs +1 -2
  114. package/build/legacy/useQueries.d.cts +0 -2
  115. package/build/legacy/useQueries.d.cts.map +1 -1
  116. package/build/legacy/useQueries.d.ts +0 -2
  117. package/build/legacy/useQueries.d.ts.map +1 -1
  118. package/build/legacy/useQueries.js +1 -2
  119. package/build/legacy/useQuery.cjs +1 -2
  120. package/build/legacy/useQuery.cjs.map +1 -1
  121. package/build/legacy/useQuery.d.cts +5 -7
  122. package/build/legacy/useQuery.d.cts.map +1 -1
  123. package/build/legacy/useQuery.d.ts +5 -7
  124. package/build/legacy/useQuery.d.ts.map +1 -1
  125. package/build/legacy/useQuery.js +1 -2
  126. package/build/legacy/useQuery.js.map +1 -1
  127. package/build/legacy/useSuspenseInfiniteQuery.cjs +1 -2
  128. package/build/legacy/useSuspenseInfiniteQuery.d.cts +0 -2
  129. package/build/legacy/useSuspenseInfiniteQuery.d.cts.map +1 -1
  130. package/build/legacy/useSuspenseInfiniteQuery.d.ts +0 -2
  131. package/build/legacy/useSuspenseInfiniteQuery.d.ts.map +1 -1
  132. package/build/legacy/useSuspenseInfiniteQuery.js +1 -2
  133. package/build/legacy/useSuspenseQueries.cjs +1 -2
  134. package/build/legacy/useSuspenseQueries.d.cts +0 -2
  135. package/build/legacy/useSuspenseQueries.d.cts.map +1 -1
  136. package/build/legacy/useSuspenseQueries.d.ts +0 -2
  137. package/build/legacy/useSuspenseQueries.d.ts.map +1 -1
  138. package/build/legacy/useSuspenseQueries.js +1 -2
  139. package/build/legacy/useSuspenseQuery.cjs +1 -2
  140. package/build/legacy/useSuspenseQuery.d.cts +0 -2
  141. package/build/legacy/useSuspenseQuery.d.cts.map +1 -1
  142. package/build/legacy/useSuspenseQuery.d.ts +0 -2
  143. package/build/legacy/useSuspenseQuery.d.ts.map +1 -1
  144. package/build/legacy/useSuspenseQuery.js +1 -2
  145. package/build/legacy/utils.cjs +1 -2
  146. package/build/legacy/utils.d.cts +0 -2
  147. package/build/legacy/utils.d.cts.map +1 -1
  148. package/build/legacy/utils.d.ts +0 -2
  149. package/build/legacy/utils.d.ts.map +1 -1
  150. package/build/legacy/utils.js +1 -2
  151. package/build/modern/HydrationBoundary.cjs +1 -2
  152. package/build/modern/HydrationBoundary.d.cts +0 -2
  153. package/build/modern/HydrationBoundary.d.cts.map +1 -1
  154. package/build/modern/HydrationBoundary.d.ts +0 -2
  155. package/build/modern/HydrationBoundary.d.ts.map +1 -1
  156. package/build/modern/HydrationBoundary.js +1 -2
  157. package/build/modern/IsRestoringProvider.cjs +1 -2
  158. package/build/modern/IsRestoringProvider.d.cts +0 -2
  159. package/build/modern/IsRestoringProvider.d.cts.map +1 -1
  160. package/build/modern/IsRestoringProvider.d.ts +0 -2
  161. package/build/modern/IsRestoringProvider.d.ts.map +1 -1
  162. package/build/modern/IsRestoringProvider.js +1 -2
  163. package/build/modern/QueryClientProvider.cjs +1 -2
  164. package/build/modern/QueryClientProvider.d.cts +0 -2
  165. package/build/modern/QueryClientProvider.d.cts.map +1 -1
  166. package/build/modern/QueryClientProvider.d.ts +0 -2
  167. package/build/modern/QueryClientProvider.d.ts.map +1 -1
  168. package/build/modern/QueryClientProvider.js +1 -2
  169. package/build/modern/QueryErrorResetBoundary.cjs +1 -2
  170. package/build/modern/QueryErrorResetBoundary.d.cts +0 -2
  171. package/build/modern/QueryErrorResetBoundary.d.cts.map +1 -1
  172. package/build/modern/QueryErrorResetBoundary.d.ts +0 -2
  173. package/build/modern/QueryErrorResetBoundary.d.ts.map +1 -1
  174. package/build/modern/QueryErrorResetBoundary.js +1 -2
  175. package/build/modern/errorBoundaryUtils.cjs +1 -2
  176. package/build/modern/errorBoundaryUtils.d.cts +0 -2
  177. package/build/modern/errorBoundaryUtils.d.cts.map +1 -1
  178. package/build/modern/errorBoundaryUtils.d.ts +0 -2
  179. package/build/modern/errorBoundaryUtils.d.ts.map +1 -1
  180. package/build/modern/errorBoundaryUtils.js +1 -2
  181. package/build/modern/index.cjs +1 -2
  182. package/build/modern/index.js +1 -2
  183. package/build/modern/infiniteQueryOptions.cjs +1 -2
  184. package/build/modern/infiniteQueryOptions.cjs.map +1 -1
  185. package/build/modern/infiniteQueryOptions.d.cts +16 -16
  186. package/build/modern/infiniteQueryOptions.d.cts.map +1 -1
  187. package/build/modern/infiniteQueryOptions.d.ts +16 -16
  188. package/build/modern/infiniteQueryOptions.d.ts.map +1 -1
  189. package/build/modern/infiniteQueryOptions.js +1 -2
  190. package/build/modern/infiniteQueryOptions.js.map +1 -1
  191. package/build/modern/mutationOptions.cjs +1 -2
  192. package/build/modern/mutationOptions.d.cts +0 -2
  193. package/build/modern/mutationOptions.d.cts.map +1 -1
  194. package/build/modern/mutationOptions.d.ts +0 -2
  195. package/build/modern/mutationOptions.d.ts.map +1 -1
  196. package/build/modern/mutationOptions.js +1 -2
  197. package/build/modern/queryOptions.cjs +1 -2
  198. package/build/modern/queryOptions.cjs.map +1 -1
  199. package/build/modern/queryOptions.d.cts +16 -15
  200. package/build/modern/queryOptions.d.cts.map +1 -1
  201. package/build/modern/queryOptions.d.ts +16 -15
  202. package/build/modern/queryOptions.d.ts.map +1 -1
  203. package/build/modern/queryOptions.js +1 -2
  204. package/build/modern/queryOptions.js.map +1 -1
  205. package/build/modern/suspense.cjs +1 -2
  206. package/build/modern/suspense.d.cts +0 -2
  207. package/build/modern/suspense.d.cts.map +1 -1
  208. package/build/modern/suspense.d.ts +0 -2
  209. package/build/modern/suspense.d.ts.map +1 -1
  210. package/build/modern/suspense.js +1 -2
  211. package/build/modern/types.cjs +1 -2
  212. package/build/modern/types.d.cts +0 -2
  213. package/build/modern/types.d.cts.map +1 -1
  214. package/build/modern/types.d.ts +0 -2
  215. package/build/modern/types.d.ts.map +1 -1
  216. package/build/modern/types.js +1 -2
  217. package/build/modern/useBaseQuery.cjs +1 -2
  218. package/build/modern/useBaseQuery.d.cts +0 -2
  219. package/build/modern/useBaseQuery.d.cts.map +1 -1
  220. package/build/modern/useBaseQuery.d.ts +0 -2
  221. package/build/modern/useBaseQuery.d.ts.map +1 -1
  222. package/build/modern/useBaseQuery.js +1 -2
  223. package/build/modern/useInfiniteQuery.cjs +1 -2
  224. package/build/modern/useInfiniteQuery.cjs.map +1 -1
  225. package/build/modern/useInfiniteQuery.d.cts +2 -4
  226. package/build/modern/useInfiniteQuery.d.cts.map +1 -1
  227. package/build/modern/useInfiniteQuery.d.ts +2 -4
  228. package/build/modern/useInfiniteQuery.d.ts.map +1 -1
  229. package/build/modern/useInfiniteQuery.js +1 -2
  230. package/build/modern/useInfiniteQuery.js.map +1 -1
  231. package/build/modern/useIsFetching.cjs +1 -2
  232. package/build/modern/useIsFetching.cjs.map +1 -1
  233. package/build/modern/useIsFetching.d.cts +1 -3
  234. package/build/modern/useIsFetching.d.cts.map +1 -1
  235. package/build/modern/useIsFetching.d.ts +1 -3
  236. package/build/modern/useIsFetching.d.ts.map +1 -1
  237. package/build/modern/useIsFetching.js +1 -2
  238. package/build/modern/useIsFetching.js.map +1 -1
  239. package/build/modern/useMutation.cjs +1 -2
  240. package/build/modern/useMutation.d.cts +0 -2
  241. package/build/modern/useMutation.d.cts.map +1 -1
  242. package/build/modern/useMutation.d.ts +0 -2
  243. package/build/modern/useMutation.d.ts.map +1 -1
  244. package/build/modern/useMutation.js +1 -2
  245. package/build/modern/useMutationState.cjs +1 -2
  246. package/build/modern/useMutationState.d.cts +0 -2
  247. package/build/modern/useMutationState.d.cts.map +1 -1
  248. package/build/modern/useMutationState.d.ts +0 -2
  249. package/build/modern/useMutationState.d.ts.map +1 -1
  250. package/build/modern/useMutationState.js +1 -2
  251. package/build/modern/usePrefetchInfiniteQuery.cjs +1 -2
  252. package/build/modern/usePrefetchInfiniteQuery.d.cts +0 -2
  253. package/build/modern/usePrefetchInfiniteQuery.d.cts.map +1 -1
  254. package/build/modern/usePrefetchInfiniteQuery.d.ts +0 -2
  255. package/build/modern/usePrefetchInfiniteQuery.d.ts.map +1 -1
  256. package/build/modern/usePrefetchInfiniteQuery.js +1 -2
  257. package/build/modern/usePrefetchQuery.cjs +1 -2
  258. package/build/modern/usePrefetchQuery.d.cts +0 -2
  259. package/build/modern/usePrefetchQuery.d.cts.map +1 -1
  260. package/build/modern/usePrefetchQuery.d.ts +0 -2
  261. package/build/modern/usePrefetchQuery.d.ts.map +1 -1
  262. package/build/modern/usePrefetchQuery.js +1 -2
  263. package/build/modern/useQueries.cjs +1 -2
  264. package/build/modern/useQueries.d.cts +0 -2
  265. package/build/modern/useQueries.d.cts.map +1 -1
  266. package/build/modern/useQueries.d.ts +0 -2
  267. package/build/modern/useQueries.d.ts.map +1 -1
  268. package/build/modern/useQueries.js +1 -2
  269. package/build/modern/useQuery.cjs +1 -2
  270. package/build/modern/useQuery.cjs.map +1 -1
  271. package/build/modern/useQuery.d.cts +5 -7
  272. package/build/modern/useQuery.d.cts.map +1 -1
  273. package/build/modern/useQuery.d.ts +5 -7
  274. package/build/modern/useQuery.d.ts.map +1 -1
  275. package/build/modern/useQuery.js +1 -2
  276. package/build/modern/useQuery.js.map +1 -1
  277. package/build/modern/useSuspenseInfiniteQuery.cjs +1 -2
  278. package/build/modern/useSuspenseInfiniteQuery.d.cts +0 -2
  279. package/build/modern/useSuspenseInfiniteQuery.d.cts.map +1 -1
  280. package/build/modern/useSuspenseInfiniteQuery.d.ts +0 -2
  281. package/build/modern/useSuspenseInfiniteQuery.d.ts.map +1 -1
  282. package/build/modern/useSuspenseInfiniteQuery.js +1 -2
  283. package/build/modern/useSuspenseQueries.cjs +1 -2
  284. package/build/modern/useSuspenseQueries.d.cts +0 -2
  285. package/build/modern/useSuspenseQueries.d.cts.map +1 -1
  286. package/build/modern/useSuspenseQueries.d.ts +0 -2
  287. package/build/modern/useSuspenseQueries.d.ts.map +1 -1
  288. package/build/modern/useSuspenseQueries.js +1 -2
  289. package/build/modern/useSuspenseQuery.cjs +1 -2
  290. package/build/modern/useSuspenseQuery.d.cts +0 -2
  291. package/build/modern/useSuspenseQuery.d.cts.map +1 -1
  292. package/build/modern/useSuspenseQuery.d.ts +0 -2
  293. package/build/modern/useSuspenseQuery.d.ts.map +1 -1
  294. package/build/modern/useSuspenseQuery.js +1 -2
  295. package/build/modern/utils.cjs +1 -2
  296. package/build/modern/utils.d.cts +0 -2
  297. package/build/modern/utils.d.cts.map +1 -1
  298. package/build/modern/utils.d.ts +0 -2
  299. package/build/modern/utils.d.ts.map +1 -1
  300. package/build/modern/utils.js +1 -2
  301. package/package.json +3 -3
  302. package/src/infiniteQueryOptions.ts +15 -14
  303. package/src/queryOptions.ts +16 -13
  304. package/src/useInfiniteQuery.ts +2 -2
  305. package/src/useIsFetching.ts +1 -1
  306. package/src/useQuery.ts +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"useQuery.js","names":[],"sources":["../../src/useQuery.ts"],"sourcesContent":["import { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\n\n/**\n * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless\n * a `select` changes `TData` to include `undefined`).\n * @param options - The {@link DefinedInitialDataOptions} to use — everything you can pass to `useQuery`, with `initialData` set.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n * be used.\n * @returns The current query result, typed so that `status` is `success` — or `error` if a fetch attempt\n * fails while keeping the existing data (`status` never resolves to `pending` in this overload's type,\n * since `initialData` guarantees data upfront). `isSuccess`/`isError` are derived booleans for convenience.\n * @see {@link queryOptions} to share these options between `useQuery` and imperative APIs like `queryClient.query`.\n * @example\n * ```tsx\n * import { useQuery } from '@tanstack/preact-query'\n *\n * function Posts() {\n * // `data` is `Post[]`, never `undefined`, thanks to `initialData` — even if a refetch fails,\n * // so the list stays visible alongside the error.\n * const { data, isError, error } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * initialData: [],\n * })\n *\n * return (\n * <div>\n * {isError ? <span>Error: {error.message}</span> : null}\n * <ul>\n * {data.map((post) => <li key={post.id}>{post.title}</li>)}\n * </ul>\n * </div>\n * )\n * }\n * ```\n */\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError>\n\n/**\n * This overload is selected when `initialData` is omitted or may be `undefined`, so the resulting `data`\n * can be `undefined`.\n * @param options - The {@link UndefinedInitialDataOptions} to use — everything you can pass to `useQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n * be used.\n * @returns The current query result. `status` is `pending` if there is no cached data to display, `error` if\n * the last fetch attempt failed, or `success` if the query has data to display. `isPending`/`isSuccess`/`isError`\n * are derived booleans for convenience.\n * @see {@link queryOptions} to share these options between `useQuery` and imperative APIs like `queryClient.query`.\n * @example\n * ```tsx\n * import { useQuery } from '@tanstack/preact-query'\n *\n * function Posts() {\n * const { status, data, error, isFetching } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * })\n *\n * if (status === 'pending') return 'Loading...'\n * if (status === 'error') return <span>Error: {error.message}</span>\n *\n * return (\n * <div>\n * <ul>\n * {data.map((post) => (\n * <li key={post.id}>{post.title}</li>\n * ))}\n * </ul>\n * <div>{isFetching ? 'Background Updating...' : ' '}</div>\n * </div>\n * )\n * }\n * ```\n * @example\n * The same query, checking `isPending`/`isError` instead of `status` — pick whichever reads better to you:\n * ```tsx\n * import { useQuery } from '@tanstack/preact-query'\n *\n * function Posts() {\n * const { isPending, isError, data, error } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * })\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return (\n * <ul>\n * {data.map((post) => <li key={post.id}>{post.title}</li>)}\n * </ul>\n * )\n * }\n * ```\n */\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError>\n\n/**\n * Fallback overload for options whose `initialData` presence isn't statically known — for example, an\n * object typed as {@link UseQueryOptions} rather than an object literal. Prefer one of the other overloads\n * when possible, since they infer whether `data` can be `undefined` from `initialData` directly.\n * @param options - The {@link UseQueryOptions} to use — everything you can pass to `useQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n * be used.\n * @returns The current query result. `status` is `pending` if there is no cached data to display, `error` if\n * the last fetch attempt failed, or `success` if the query has data to display. `isPending`/`isSuccess`/`isError`\n * are derived booleans for convenience.\n * @see {@link queryOptions} to share these options between `useQuery` and imperative APIs like `queryClient.query`.\n * @example\n * ```tsx\n * import { useQuery } from '@tanstack/preact-query'\n *\n * function Posts() {\n * const { status, data, error, isFetching } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * })\n *\n * if (status === 'pending') return 'Loading...'\n * if (status === 'error') return <span>Error: {error.message}</span>\n *\n * return (\n * <div>\n * <ul>\n * {data.map((post) => (\n * <li key={post.id}>{post.title}</li>\n * ))}\n * </ul>\n * <div>{isFetching ? 'Background Updating...' : ' '}</div>\n * </div>\n * )\n * }\n * ```\n * @example\n * `select` derives whatever `data` a component needs from the cached value, without changing what's\n * actually stored in the cache — the cache still holds the full `Post[]`, but `data` here is a `number`:\n * ```tsx\n * import { useQuery } from '@tanstack/preact-query'\n *\n * function PostCount() {\n * const { data, isPending, isError, error } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * select: (posts) => posts.length,\n * })\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <span>{data} posts</span>\n * }\n * ```\n * @example\n * A dependent query, only enabled once `postId` is set — use `isLoading`, not `isPending`, so the\n * loading state doesn't show while the query is disabled:\n * ```tsx\n * import { useQuery } from '@tanstack/preact-query'\n *\n * function Post({ postId }: { postId: number | undefined }) {\n * const { data, isLoading, isError, error } = useQuery({\n * queryKey: ['post', postId],\n * queryFn: () => fetchPost(postId!),\n * enabled: postId != null,\n * })\n *\n * if (postId == null) return 'Select a post'\n * if (isLoading) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <h1>{data?.title}</h1>\n * }\n * ```\n * @example\n * The same dependent query, type safe: `skipToken` disables the query without needing the\n * non-null assertion above, since `queryFn` is only ever called when `postId` is defined.\n * `refetch` doesn't work while `queryFn` is `skipToken` — use `enabled: false` instead if you\n * need to trigger the query manually:\n * ```tsx\n * import { skipToken, useQuery } from '@tanstack/preact-query'\n *\n * function Post({ postId }: { postId: number | undefined }) {\n * const { data, isLoading, isError, error } = useQuery({\n * queryKey: ['post', postId],\n * queryFn: postId != null ? () => fetchPost(postId) : skipToken,\n * })\n *\n * if (postId == null) return 'Select a post'\n * if (isLoading) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <h1>{data?.title}</h1>\n * }\n * ```\n * @example\n * Seeding a detail query from an already-cached list, to skip the loading state. `initialDataUpdatedAt` carries\n * over the list's own fetch time, so that if you set a `staleTime`, it's measured from when the list was\n * fetched rather than from now:\n * ```tsx\n * import { useQuery, useQueryClient } from '@tanstack/preact-query'\n *\n * function Post({ postId }: { postId: number }) {\n * const queryClient = useQueryClient()\n *\n * const { data, isError, error } = useQuery({\n * queryKey: ['post', postId],\n * queryFn: () => fetchPost(postId),\n * initialData: () =>\n * queryClient\n * .getQueryData<Array<Post>>(['posts'])\n * ?.find((post) => post.id === postId),\n * initialDataUpdatedAt: () =>\n * queryClient.getQueryState(['posts'])?.dataUpdatedAt,\n * })\n *\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <h1>{data?.title}</h1>\n * }\n * ```\n * @example\n * Paginated data, keeping the previous page's data visible while the next page loads:\n * ```tsx\n * import { keepPreviousData, useQuery } from '@tanstack/preact-query'\n * import { useState } from 'preact/hooks'\n *\n * function Posts() {\n * const [page, setPage] = useState(0)\n *\n * const { data, isPlaceholderData, isError, error } = useQuery({\n * queryKey: ['posts', page],\n * queryFn: () => fetchPosts(page),\n * placeholderData: keepPreviousData,\n * })\n *\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return (\n * <div>\n * <ul>\n * {data?.map((post) => <li key={post.id}>{post.title}</li>)}\n * </ul>\n * <button\n * disabled={isPlaceholderData}\n * onClick={() => setPage((old) => old + 1)}\n * >\n * Next Page\n * </button>\n * </div>\n * )\n * }\n * ```\n */\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError>\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;AAkSA,SAAgB,SAAS,SAA0B,aAA2B;CAC5E,OAAO,aAAa,SAAS,eAAe,WAAW;AACzD"}
1
+ {"version":3,"file":"useQuery.js","names":[],"sources":["../../src/useQuery.ts"],"sourcesContent":["import { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\n\n/**\n * This overload is selected when `initialData` is known to be defined, so the resulting `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n * @param options - The {@link DefinedInitialDataOptions} to use — everything you can pass to `useQuery`, with `initialData` known to be defined.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n * be used.\n * @returns The current query result, typed so that `status` is `success` — or `error` if a fetch attempt\n * fails while keeping the existing data (`status` never resolves to `pending` in this overload's type,\n * since `initialData` guarantees data upfront). `isSuccess`/`isError` are derived booleans for convenience.\n * @see {@link queryOptions} to share these options between `useQuery` and imperative APIs like `queryClient.query`.\n * @example\n * ```tsx\n * import { useQuery } from '@tanstack/preact-query'\n *\n * function Posts() {\n * // `data` is `Post[]`, never `undefined`, thanks to `initialData` — even if a refetch fails,\n * // so the list stays visible alongside the error.\n * const { data, isError, error } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * initialData: [],\n * })\n *\n * return (\n * <div>\n * {isError ? <span>Error: {error.message}</span> : null}\n * <ul>\n * {data.map((post) => <li key={post.id}>{post.title}</li>)}\n * </ul>\n * </div>\n * )\n * }\n * ```\n */\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError>\n\n/**\n * This overload is selected when `initialData` is omitted, may be `undefined`, or is a function that may\n * return `undefined`, so the resulting `data` can be `undefined`.\n * @param options - The {@link UndefinedInitialDataOptions} to use — everything you can pass to `useQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n * be used.\n * @returns The current query result. `status` is `pending` if there is no cached data to display, `error` if\n * the last fetch attempt failed, or `success` if the query has data to display. `isPending`/`isSuccess`/`isError`\n * are derived booleans for convenience.\n * @see {@link queryOptions} to share these options between `useQuery` and imperative APIs like `queryClient.query`.\n * @example\n * ```tsx\n * import { useQuery } from '@tanstack/preact-query'\n *\n * function Posts() {\n * const { status, data, error, isFetching } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * })\n *\n * if (status === 'pending') return 'Loading...'\n * if (status === 'error') return <span>Error: {error.message}</span>\n *\n * return (\n * <div>\n * <ul>\n * {data.map((post) => (\n * <li key={post.id}>{post.title}</li>\n * ))}\n * </ul>\n * <div>{isFetching ? 'Background Updating...' : ' '}</div>\n * </div>\n * )\n * }\n * ```\n * @example\n * The same query, checking `isPending`/`isError` instead of `status` — pick whichever reads better to you:\n * ```tsx\n * import { useQuery } from '@tanstack/preact-query'\n *\n * function Posts() {\n * const { isPending, isError, data, error } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * })\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return (\n * <ul>\n * {data.map((post) => <li key={post.id}>{post.title}</li>)}\n * </ul>\n * )\n * }\n * ```\n */\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError>\n\n/**\n * Fallback overload for options whose `initialData` presence isn't statically known — for example, an\n * object typed as {@link UseQueryOptions} rather than an object literal. Prefer one of the other overloads\n * when possible, since they infer whether `data` can be `undefined` from `initialData` directly.\n * @param options - The {@link UseQueryOptions} to use — everything you can pass to `useQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n * be used.\n * @returns The current query result. `status` is `pending` if there is no cached data to display, `error` if\n * the last fetch attempt failed, or `success` if the query has data to display. `isPending`/`isSuccess`/`isError`\n * are derived booleans for convenience.\n * @see {@link queryOptions} to share these options between `useQuery` and imperative APIs like `queryClient.query`.\n * @example\n * ```tsx\n * import { useQuery } from '@tanstack/preact-query'\n *\n * function Posts() {\n * const { status, data, error, isFetching } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * })\n *\n * if (status === 'pending') return 'Loading...'\n * if (status === 'error') return <span>Error: {error.message}</span>\n *\n * return (\n * <div>\n * <ul>\n * {data.map((post) => (\n * <li key={post.id}>{post.title}</li>\n * ))}\n * </ul>\n * <div>{isFetching ? 'Background Updating...' : ' '}</div>\n * </div>\n * )\n * }\n * ```\n * @example\n * `select` derives whatever `data` a component needs from the cached value, without changing what's\n * actually stored in the cache — the cache still holds the full `Post[]`, but `data` here is a `number`:\n * ```tsx\n * import { useQuery } from '@tanstack/preact-query'\n *\n * function PostCount() {\n * const { data, isPending, isError, error } = useQuery({\n * queryKey: ['posts'],\n * queryFn: fetchPosts,\n * select: (posts) => posts.length,\n * })\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <span>{data} posts</span>\n * }\n * ```\n * @example\n * A dependent query, only enabled once `postId` is set — use `isLoading`, not `isPending`, so the\n * loading state doesn't show while the query is disabled:\n * ```tsx\n * import { useQuery } from '@tanstack/preact-query'\n *\n * function Post({ postId }: { postId: number | undefined }) {\n * const { data, isLoading, isError, error } = useQuery({\n * queryKey: ['post', postId],\n * queryFn: () => fetchPost(postId!),\n * enabled: postId != null,\n * })\n *\n * if (postId == null) return 'Select a post'\n * if (isLoading) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <h1>{data?.title}</h1>\n * }\n * ```\n * @example\n * The same dependent query, type safe: `skipToken` disables the query without needing the\n * non-null assertion above, since `queryFn` is only ever called when `postId` is defined.\n * `refetch` doesn't work while `queryFn` is `skipToken` — use `enabled: false` instead if you\n * need to trigger the query manually:\n * ```tsx\n * import { skipToken, useQuery } from '@tanstack/preact-query'\n *\n * function Post({ postId }: { postId: number | undefined }) {\n * const { data, isLoading, isError, error } = useQuery({\n * queryKey: ['post', postId],\n * queryFn: postId != null ? () => fetchPost(postId) : skipToken,\n * })\n *\n * if (postId == null) return 'Select a post'\n * if (isLoading) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <h1>{data?.title}</h1>\n * }\n * ```\n * @example\n * Seeding a detail query from an already-cached list, to skip the loading state. `initialDataUpdatedAt` carries\n * over the list's own fetch time, so that if you set a `staleTime`, it's measured from when the list was\n * fetched rather than from now:\n * ```tsx\n * import { useQuery, useQueryClient } from '@tanstack/preact-query'\n *\n * function Post({ postId }: { postId: number }) {\n * const queryClient = useQueryClient()\n *\n * const { data, isError, error } = useQuery({\n * queryKey: ['post', postId],\n * queryFn: () => fetchPost(postId),\n * initialData: () =>\n * queryClient\n * .getQueryData<Array<Post>>(['posts'])\n * ?.find((post) => post.id === postId),\n * initialDataUpdatedAt: () =>\n * queryClient.getQueryState(['posts'])?.dataUpdatedAt,\n * })\n *\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return <h1>{data?.title}</h1>\n * }\n * ```\n * @example\n * Paginated data, keeping the previous page's data visible while the next page loads:\n * ```tsx\n * import { keepPreviousData, useQuery } from '@tanstack/preact-query'\n * import { useState } from 'preact/hooks'\n *\n * function Posts() {\n * const [page, setPage] = useState(0)\n *\n * const { data, isPlaceholderData, isError, error } = useQuery({\n * queryKey: ['posts', page],\n * queryFn: () => fetchPosts(page),\n * placeholderData: keepPreviousData,\n * })\n *\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return (\n * <div>\n * <ul>\n * {data?.map((post) => <li key={post.id}>{post.title}</li>)}\n * </ul>\n * <button\n * disabled={isPlaceholderData}\n * onClick={() => setPage((old) => old + 1)}\n * >\n * Next Page\n * </button>\n * </div>\n * )\n * }\n * ```\n */\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError>\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n"],"mappings":";;;AAkSA,SAAgB,SAAS,SAA0B,aAA2B;CAC5E,OAAO,aAAa,SAAS,eAAe,WAAW;AACzD"}
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_suspense = require("./suspense.cjs");
3
3
  const require_useBaseQuery = require("./useBaseQuery.cjs");
4
4
  let _tanstack_query_core = require("@tanstack/query-core");
5
- //#region src/useSuspenseInfiniteQuery.ts
5
+ // src/useSuspenseInfiniteQuery.ts
6
6
  /**
7
7
  * The options for `useSuspenseInfiniteQuery` are the same as for `useInfiniteQuery`, except for `throwOnError`,
8
8
  * `enabled`, and `placeholderData`.
@@ -119,7 +119,6 @@ function useSuspenseInfiniteQuery(options, queryClient) {
119
119
  placeholderData: void 0
120
120
  }, _tanstack_query_core.InfiniteQueryObserver, queryClient);
121
121
  }
122
- //#endregion
123
122
  exports.useSuspenseInfiniteQuery = useSuspenseInfiniteQuery;
124
123
 
125
124
  //# sourceMappingURL=useSuspenseInfiniteQuery.cjs.map
@@ -1,6 +1,5 @@
1
1
  import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from "./types.cjs";
2
2
  import { DefaultError, InfiniteData, QueryClient, QueryKey } from "@tanstack/query-core";
3
- //#region src/useSuspenseInfiniteQuery.d.ts
4
3
  /**
5
4
  * The options for `useSuspenseInfiniteQuery` are the same as for `useInfiniteQuery`, except for `throwOnError`,
6
5
  * `enabled`, and `placeholderData`.
@@ -106,5 +105,4 @@ import { DefaultError, InfiniteData, QueryClient, QueryKey } from "@tanstack/que
106
105
  * ```
107
106
  */
108
107
  export declare function useSuspenseInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult<TData, TError>;
109
- //#endregion
110
108
  //# sourceMappingURL=useSuspenseInfiniteQuery.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSuspenseInfiniteQuery.d.cts","names":[],"sources":["../../src/useSuspenseInfiniteQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAyHgB,yBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,gCACP,cACA,QACA,OACA,WACA,aAEF,cAAc,cACb,+BAA+B,OAAO"}
1
+ {"version":3,"file":"useSuspenseInfiniteQuery.d.cts","names":[],"sources":["../../src/useSuspenseInfiniteQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAyHgB,yBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,gCACP,cACA,QACA,OACA,WACA,aAEF,cAAc,cACb,+BAA+B,OAAO"}
@@ -1,6 +1,5 @@
1
1
  import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from "./types.js";
2
2
  import { DefaultError, InfiniteData, QueryClient, QueryKey } from "@tanstack/query-core";
3
- //#region src/useSuspenseInfiniteQuery.d.ts
4
3
  /**
5
4
  * The options for `useSuspenseInfiniteQuery` are the same as for `useInfiniteQuery`, except for `throwOnError`,
6
5
  * `enabled`, and `placeholderData`.
@@ -106,5 +105,4 @@ import { DefaultError, InfiniteData, QueryClient, QueryKey } from "@tanstack/que
106
105
  * ```
107
106
  */
108
107
  export declare function useSuspenseInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseSuspenseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, queryClient?: QueryClient): UseSuspenseInfiniteQueryResult<TData, TError>;
109
- //#endregion
110
108
  //# sourceMappingURL=useSuspenseInfiniteQuery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSuspenseInfiniteQuery.d.ts","names":[],"sources":["../../src/useSuspenseInfiniteQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAyHgB,yBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,gCACP,cACA,QACA,OACA,WACA,aAEF,cAAc,cACb,+BAA+B,OAAO"}
1
+ {"version":3,"file":"useSuspenseInfiniteQuery.d.ts","names":[],"sources":["../../src/useSuspenseInfiniteQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAyHgB,yBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,gCACP,cACA,QACA,OACA,WACA,aAEF,cAAc,cACb,+BAA+B,OAAO"}
@@ -1,7 +1,7 @@
1
1
  import { defaultThrowOnError } from "./suspense.js";
2
2
  import { useBaseQuery } from "./useBaseQuery.js";
3
3
  import { InfiniteQueryObserver, skipToken } from "@tanstack/query-core";
4
- //#region src/useSuspenseInfiniteQuery.ts
4
+ // src/useSuspenseInfiniteQuery.ts
5
5
  /**
6
6
  * The options for `useSuspenseInfiniteQuery` are the same as for `useInfiniteQuery`, except for `throwOnError`,
7
7
  * `enabled`, and `placeholderData`.
@@ -118,7 +118,6 @@ function useSuspenseInfiniteQuery(options, queryClient) {
118
118
  placeholderData: void 0
119
119
  }, InfiniteQueryObserver, queryClient);
120
120
  }
121
- //#endregion
122
121
  export { useSuspenseInfiniteQuery };
123
122
 
124
123
  //# sourceMappingURL=useSuspenseInfiniteQuery.js.map
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_suspense = require("./suspense.cjs");
3
3
  const require_useQueries = require("./useQueries.cjs");
4
4
  let _tanstack_query_core = require("@tanstack/query-core");
5
- //#region src/useSuspenseQueries.ts
5
+ // src/useSuspenseQueries.ts
6
6
  function useSuspenseQueries(options, queryClient) {
7
7
  return require_useQueries.useQueries({
8
8
  ...options,
@@ -20,7 +20,6 @@ function useSuspenseQueries(options, queryClient) {
20
20
  })
21
21
  }, queryClient);
22
22
  }
23
- //#endregion
24
23
  exports.useSuspenseQueries = useSuspenseQueries;
25
24
 
26
25
  //# sourceMappingURL=useSuspenseQueries.cjs.map
@@ -1,6 +1,5 @@
1
1
  import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from "./types.cjs";
2
2
  import { DefaultError, QueryClient, QueryFunction, ThrowOnError } from "@tanstack/query-core";
3
- //#region src/useSuspenseQueries.d.ts
4
3
  type MAXIMUM_DEPTH = 20;
5
4
  type SkipTokenForUseQueries = symbol;
6
5
  type GetUseSuspenseQueryOptions<T> = T extends {
@@ -468,5 +467,4 @@ export declare function useSuspenseQueries<T extends Array<any>, TCombinedResult
468
467
  */
469
468
  combine?: (result: SuspenseQueriesResults<T>) => TCombinedResult;
470
469
  }, queryClient?: QueryClient): TCombinedResult;
471
- //#endregion
472
470
  //# sourceMappingURL=useSuspenseQueries.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSuspenseQueries.d.cts","names":[],"sources":["../../src/useSuspenseQueries.ts"],"mappings":";;;KAaK;KAGA;KAEA,2BAA2B,KAE9B;EACE,mBAAmB;EACnB,cAAc;EACd,YAAY;IAEV,wBAAwB,cAAc,QAAQ,SAC9C;EAAY,mBAAmB;EAAc,cAAc;IACzD,wBAAwB,cAAc,UACtC;EAAY,YAAY;EAAO,cAAc;IAC3C,iCAAiC,QAAQ,SAEzC,iBAAiB,oBAAoB,cAAc,SACjD,wBAAwB,cAAc,QAAQ,SAC9C,iBAAiB,oBAAoB,UACnC,wBAAwB,cAAc,UACtC,iBAAiB,gBACf,wBAAwB,gBAExB;EACI,UACI,oBAAoB,oBAAoB,aACxC;EACJ,UAAU,oBAAoB;EAC9B,eAAe,wBAAwB;IAEzC,wBACE,cACA,QACA,OACA,aAEF;EACI,UACI,oBAAoB,oBAAoB,aACxC;EACJ,eAAe,wBAAwB;IAEzC,wBACE,cACA,QACA,cACA,aAGF;KAEf,0BAA0B,KAE7B;EAAY;EAAkB,cAAc;EAAQ,YAAY;IAC5D,uBAAuB,OAAO,UAC9B;EAAY,mBAAmB;EAAc,cAAc;IACzD,uBAAuB,cAAc,UACrC;EAAY,YAAY;EAAO,cAAc;IAC3C,uBAAuB,OAAO,UAE9B,sBAAsB,cAAc,SAClC,uBAAuB,OAAO,UAC9B,iBAAiB,oBAAoB,UACnC,uBAAuB,cAAc,UACrC,iBAAiB,gBACf,uBAAuB,gBAEvB;EACI,UACI,oBAAoB,qBACpB;EACJ,UAAU,oBAAoB;EAC9B,eAAe,wBAAwB;IAEzC,uCACkB,QAAQ,eAAe,uBACvB,SAAS,eAAe,UAE1C;EACI,UACI,oBAAoB,qBACpB;EACJ,eAAe,wBAAwB;IAEzC,uBACE,8BACgB,SAAS,eAAe,UAG1C;;;;;;;;;;;;;;;;YAiBR,uBACV,UAAU,YAC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UseSuspenseQueryResult } from "./types.js";
2
2
  import { DefaultError, QueryClient, QueryFunction, ThrowOnError } from "@tanstack/query-core";
3
- //#region src/useSuspenseQueries.d.ts
4
3
  type MAXIMUM_DEPTH = 20;
5
4
  type SkipTokenForUseQueries = symbol;
6
5
  type GetUseSuspenseQueryOptions<T> = T extends {
@@ -468,5 +467,4 @@ export declare function useSuspenseQueries<T extends Array<any>, TCombinedResult
468
467
  */
469
468
  combine?: (result: SuspenseQueriesResults<T>) => TCombinedResult;
470
469
  }, queryClient?: QueryClient): TCombinedResult;
471
- //#endregion
472
470
  //# sourceMappingURL=useSuspenseQueries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSuspenseQueries.d.ts","names":[],"sources":["../../src/useSuspenseQueries.ts"],"mappings":";;;KAaK;KAGA;KAEA,2BAA2B,KAE9B;EACE,mBAAmB;EACnB,cAAc;EACd,YAAY;IAEV,wBAAwB,cAAc,QAAQ,SAC9C;EAAY,mBAAmB;EAAc,cAAc;IACzD,wBAAwB,cAAc,UACtC;EAAY,YAAY;EAAO,cAAc;IAC3C,iCAAiC,QAAQ,SAEzC,iBAAiB,oBAAoB,cAAc,SACjD,wBAAwB,cAAc,QAAQ,SAC9C,iBAAiB,oBAAoB,UACnC,wBAAwB,cAAc,UACtC,iBAAiB,gBACf,wBAAwB,gBAExB;EACI,UACI,oBAAoB,oBAAoB,aACxC;EACJ,UAAU,oBAAoB;EAC9B,eAAe,wBAAwB;IAEzC,wBACE,cACA,QACA,OACA,aAEF;EACI,UACI,oBAAoB,oBAAoB,aACxC;EACJ,eAAe,wBAAwB;IAEzC,wBACE,cACA,QACA,cACA,aAGF;KAEf,0BAA0B,KAE7B;EAAY;EAAkB,cAAc;EAAQ,YAAY;IAC5D,uBAAuB,OAAO,UAC9B;EAAY,mBAAmB;EAAc,cAAc;IACzD,uBAAuB,cAAc,UACrC;EAAY,YAAY;EAAO,cAAc;IAC3C,uBAAuB,OAAO,UAE9B,sBAAsB,cAAc,SACl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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+Ja,mBACd,UAAU,YACV,kBAAkB,uBAAuB,IAEzC;;;;EAIE,sBAAsB,uBAAuB;;;;;EAK7C,WAAW,QAAQ,uBAAuB,OAAO;GAEnD,cAAc,cACb"}
@@ -1,7 +1,7 @@
1
1
  import { defaultThrowOnError } from "./suspense.js";
2
2
  import { useQueries } from "./useQueries.js";
3
3
  import { skipToken } from "@tanstack/query-core";
4
- //#region src/useSuspenseQueries.ts
4
+ // src/useSuspenseQueries.ts
5
5
  function useSuspenseQueries(options, queryClient) {
6
6
  return useQueries({
7
7
  ...options,
@@ -19,7 +19,6 @@ function useSuspenseQueries(options, queryClient) {
19
19
  })
20
20
  }, queryClient);
21
21
  }
22
- //#endregion
23
22
  export { useSuspenseQueries };
24
23
 
25
24
  //# sourceMappingURL=useSuspenseQueries.js.map
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_suspense = require("./suspense.cjs");
3
3
  const require_useBaseQuery = require("./useBaseQuery.cjs");
4
4
  let _tanstack_query_core = require("@tanstack/query-core");
5
- //#region src/useSuspenseQuery.ts
5
+ // src/useSuspenseQuery.ts
6
6
  /**
7
7
  * The options for `useSuspenseQuery` are the same as for `useQuery`, except for `throwOnError`, `enabled`, and
8
8
  * `placeholderData`.
@@ -100,7 +100,6 @@ function useSuspenseQuery(options, queryClient) {
100
100
  placeholderData: void 0
101
101
  }, _tanstack_query_core.QueryObserver, queryClient);
102
102
  }
103
- //#endregion
104
103
  exports.useSuspenseQuery = useSuspenseQuery;
105
104
 
106
105
  //# sourceMappingURL=useSuspenseQuery.cjs.map
@@ -1,6 +1,5 @@
1
1
  import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from "./types.cjs";
2
2
  import { DefaultError, QueryClient, QueryKey } from "@tanstack/query-core";
3
- //#region src/useSuspenseQuery.d.ts
4
3
  /**
5
4
  * The options for `useSuspenseQuery` are the same as for `useQuery`, except for `throwOnError`, `enabled`, and
6
5
  * `placeholderData`.
@@ -87,5 +86,4 @@ import { DefaultError, QueryClient, QueryKey } from "@tanstack/query-core";
87
86
  * ```
88
87
  */
89
88
  export declare function useSuspenseQuery<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError>;
90
- //#endregion
91
89
  //# sourceMappingURL=useSuspenseQuery.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSuspenseQuery.d.cts","names":[],"sources":["../../src/useSuspenseQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4FgB,iBACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,wBAAwB,cAAc,QAAQ,OAAO,YAC9D,cAAc,cACb,uBAAuB,OAAO"}
1
+ {"version":3,"file":"useSuspenseQuery.d.cts","names":[],"sources":["../../src/useSuspenseQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4FgB,iBACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,wBAAwB,cAAc,QAAQ,OAAO,YAC9D,cAAc,cACb,uBAAuB,OAAO"}
@@ -1,6 +1,5 @@
1
1
  import { UseSuspenseQueryOptions, UseSuspenseQueryResult } from "./types.js";
2
2
  import { DefaultError, QueryClient, QueryKey } from "@tanstack/query-core";
3
- //#region src/useSuspenseQuery.d.ts
4
3
  /**
5
4
  * The options for `useSuspenseQuery` are the same as for `useQuery`, except for `throwOnError`, `enabled`, and
6
5
  * `placeholderData`.
@@ -87,5 +86,4 @@ import { DefaultError, QueryClient, QueryKey } from "@tanstack/query-core";
87
86
  * ```
88
87
  */
89
88
  export declare function useSuspenseQuery<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError>;
90
- //#endregion
91
89
  //# sourceMappingURL=useSuspenseQuery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSuspenseQuery.d.ts","names":[],"sources":["../../src/useSuspenseQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4FgB,iBACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,wBAAwB,cAAc,QAAQ,OAAO,YAC9D,cAAc,cACb,uBAAuB,OAAO"}
1
+ {"version":3,"file":"useSuspenseQuery.d.ts","names":[],"sources":["../../src/useSuspenseQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4FgB,iBACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,wBAAwB,cAAc,QAAQ,OAAO,YAC9D,cAAc,cACb,uBAAuB,OAAO"}
@@ -1,7 +1,7 @@
1
1
  import { defaultThrowOnError } from "./suspense.js";
2
2
  import { useBaseQuery } from "./useBaseQuery.js";
3
3
  import { QueryObserver, skipToken } from "@tanstack/query-core";
4
- //#region src/useSuspenseQuery.ts
4
+ // src/useSuspenseQuery.ts
5
5
  /**
6
6
  * The options for `useSuspenseQuery` are the same as for `useQuery`, except for `throwOnError`, `enabled`, and
7
7
  * `placeholderData`.
@@ -99,7 +99,6 @@ function useSuspenseQuery(options, queryClient) {
99
99
  placeholderData: void 0
100
100
  }, QueryObserver, queryClient);
101
101
  }
102
- //#endregion
103
102
  export { useSuspenseQuery };
104
103
 
105
104
  //# sourceMappingURL=useSuspenseQuery.js.map
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let preact_hooks = require("preact/hooks");
3
- //#region src/utils.ts
3
+ // src/utils.ts
4
4
  /**
5
5
  * Subscribes to an external store and returns its current snapshot, re-rendering when it changes.
6
6
  * @param subscribe - Subscribes to the store, and returns a function that unsubscribes.
@@ -63,7 +63,6 @@ function useSyncExternalStoreWithSelector(subscribe, getSnapshot, selector, isEq
63
63
  };
64
64
  return useSyncExternalStore(subscribe, getSelectedSnapshot);
65
65
  }
66
- //#endregion
67
66
  exports.useSyncExternalStore = useSyncExternalStore;
68
67
  exports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;
69
68
 
@@ -1,4 +1,3 @@
1
- //#region src/utils.d.ts
2
1
  /**
3
2
  * Subscribes to an external store and returns its current snapshot, re-rendering when it changes.
4
3
  * @param subscribe - Subscribes to the store, and returns a function that unsubscribes.
@@ -16,5 +15,4 @@ export declare function useSyncExternalStore(subscribe: (onStoreChange: () => vo
16
15
  * @returns The selected part of the current snapshot.
17
16
  */
18
17
  export declare function useSyncExternalStoreWithSelector<TSnapshot, TSelected>(subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => TSnapshot, selector: (snapshot: TSnapshot) => TSelected, isEqual: (a: TSelected, b: TSelected) => boolean): TSelected;
19
- //#endregion
20
18
  //# sourceMappingURL=utils.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.cts","names":[],"sources":["../../src/utils.ts"],"mappings":";;;;;;;wBAqBgB,qBACd,YAAY,0CACZ;;;;;;;;;;wBA8Dc,iCAAiC,WAAW,WAC1D,YAAY,0CACZ,mBAAmB,WACnB,WAAW,UAAU,cAAc,WACnC,UAAU,GAAG,WAAW,GAAG,wBAC1B"}
1
+ {"version":3,"file":"utils.d.cts","names":[],"sources":["../../src/utils.ts"],"mappings":";;;;;;wBAqBgB,qBACd,YAAY,0CACZ;;;;;;;;;;wBA8Dc,iCAAiC,WAAW,WAC1D,YAAY,0CACZ,mBAAmB,WACnB,WAAW,UAAU,cAAc,WACnC,UAAU,GAAG,WAAW,GAAG,wBAC1B"}
@@ -1,4 +1,3 @@
1
- //#region src/utils.d.ts
2
1
  /**
3
2
  * Subscribes to an external store and returns its current snapshot, re-rendering when it changes.
4
3
  * @param subscribe - Subscribes to the store, and returns a function that unsubscribes.
@@ -16,5 +15,4 @@ export declare function useSyncExternalStore(subscribe: (onStoreChange: () => vo
16
15
  * @returns The selected part of the current snapshot.
17
16
  */
18
17
  export declare function useSyncExternalStoreWithSelector<TSnapshot, TSelected>(subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => TSnapshot, selector: (snapshot: TSnapshot) => TSelected, isEqual: (a: TSelected, b: TSelected) => boolean): TSelected;
19
- //#endregion
20
18
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/utils.ts"],"mappings":";;;;;;;wBAqBgB,qBACd,YAAY,0CACZ;;;;;;;;;;wBA8Dc,iCAAiC,WAAW,WAC1D,YAAY,0CACZ,mBAAmB,WACnB,WAAW,UAAU,cAAc,WACnC,UAAU,GAAG,WAAW,GAAG,wBAC1B"}
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/utils.ts"],"mappings":";;;;;;wBAqBgB,qBACd,YAAY,0CACZ;;;;;;;;;;wBA8Dc,iCAAiC,WAAW,WAC1D,YAAY,0CACZ,mBAAmB,WACnB,WAAW,UAAU,cAAc,WACnC,UAAU,GAAG,WAAW,GAAG,wBAC1B"}
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useLayoutEffect, useRef, useState } from "preact/hooks";
2
- //#region src/utils.ts
2
+ // src/utils.ts
3
3
  /**
4
4
  * Subscribes to an external store and returns its current snapshot, re-rendering when it changes.
5
5
  * @param subscribe - Subscribes to the store, and returns a function that unsubscribes.
@@ -62,7 +62,6 @@ function useSyncExternalStoreWithSelector(subscribe, getSnapshot, selector, isEq
62
62
  };
63
63
  return useSyncExternalStore(subscribe, getSelectedSnapshot);
64
64
  }
65
- //#endregion
66
65
  export { useSyncExternalStore, useSyncExternalStoreWithSelector };
67
66
 
68
67
  //# sourceMappingURL=utils.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/preact-query",
3
- "version": "5.105.0",
3
+ "version": "5.105.1",
4
4
  "description": "Hooks for managing, caching and syncing asynchronous and remote data in preact",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -43,11 +43,11 @@
43
43
  "!build/codemods/**/__tests__"
44
44
  ],
45
45
  "dependencies": {
46
- "@tanstack/query-core": "5.105.0"
46
+ "@tanstack/query-core": "5.105.1"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@preact/preset-vite": "^2.10.6",
50
- "@tanstack/query-persist-client-core": "5.105.0",
50
+ "@tanstack/query-persist-client-core": "5.105.1",
51
51
  "@tanstack/query-test-utils": "0.0.0",
52
52
  "@testing-library/preact": "^3.2.4",
53
53
  "preact": "^11.0.1",
@@ -12,8 +12,9 @@ import type {
12
12
  import type { UseInfiniteQueryOptions } from './types'
13
13
 
14
14
  /**
15
- * The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set — `data`
16
- * may be `undefined` while the query is `pending`.
15
+ * The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is omitted, may be
16
+ * `undefined`, or is a function that may return `undefined` — `data` may be `undefined` while the query is
17
+ * `pending`.
17
18
  * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
18
19
  * @template TError - The type of errors your `queryFn` may throw.
19
20
  * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,
@@ -50,9 +51,9 @@ export type UndefinedInitialDataInfiniteOptions<
50
51
  }
51
52
 
52
53
  /**
53
- * The options accepted by the `infiniteQueryOptions` overload selected when no `initialData` is set and
54
- * `queryFn` is not `skipToken` — same as {@link UndefinedInitialDataInfiniteOptions}, but `queryFn` may not be
55
- * `skipToken`.
54
+ * The options accepted by the `infiniteQueryOptions` overload selected when `queryFn` is not `skipToken` and
55
+ * `initialData` is omitted, may be `undefined`, or is a function that may return `undefined` — same as
56
+ * {@link UndefinedInitialDataInfiniteOptions}, but `queryFn` may not be `skipToken`.
56
57
  * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
57
58
  * @template TError - The type of errors your `queryFn` may throw.
58
59
  * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,
@@ -71,10 +72,11 @@ export type UnusedSkipTokenInfiniteOptions<
71
72
  'queryFn'
72
73
  > & {
73
74
  /**
74
- * `skipToken` is not allowed as a value here — this overload is selected when no `initialData` is set. If
75
- * you don't intend to run the query yet, set `enabled: false` — omitting `queryFn` alone still triggers a
76
- * fetch that fails with "Missing queryFn" unless `enabled` is `false` or a default query function has been
77
- * defined. A default query function only supplies `queryFn`; it doesn't defer the fetch on its own.
75
+ * `skipToken` is not allowed as a value here — this overload is selected when `initialData` is omitted, may
76
+ * be `undefined`, or is a function that may return `undefined`. If you don't intend to run the query yet,
77
+ * set `enabled: false` — omitting `queryFn` alone still triggers a fetch that fails with "Missing queryFn"
78
+ * unless `enabled` is `false` or a default query function has been defined. A default query function only
79
+ * supplies `queryFn`; it doesn't defer the fetch on its own.
78
80
  */
79
81
  queryFn?: Exclude<
80
82
  UseInfiniteQueryOptions<
@@ -89,8 +91,8 @@ export type UnusedSkipTokenInfiniteOptions<
89
91
  }
90
92
 
91
93
  /**
92
- * The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is set — `data` is
93
- * never `undefined` (unless a `select` changes `TData` to include `undefined`).
94
+ * The options accepted by the `infiniteQueryOptions` overload selected when `initialData` is known to be
95
+ * defined — `data` is never `undefined` (unless a `select` changes `TData` to include `undefined`).
94
96
  * @template TQueryFnData - The type of a single page, as your `queryFn` resolves it.
95
97
  * @template TError - The type of errors your `queryFn` may throw.
96
98
  * @template TData - The type `data` ends up as after `select` runs — defaults to `InfiniteData<TQueryFnData>`,
@@ -121,7 +123,6 @@ export type DefinedInitialDataInfiniteOptions<
121
123
  initialData:
122
124
  | NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>
123
125
  | (() => NonUndefinedGuard<InfiniteData<TQueryFnData, TPageParam>>)
124
- | undefined
125
126
  }
126
127
 
127
128
  /**
@@ -129,8 +130,8 @@ export type DefinedInitialDataInfiniteOptions<
129
130
  * These options can be shared across hooks and imperative APIs such as `queryClient.infiniteQuery`.
130
131
  * `options.queryKey` is required and is the query key to generate options for.
131
132
  *
132
- * This overload is selected when `initialData` is set.
133
- * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to `useInfiniteQuery`, with `initialData` set.
133
+ * This overload is selected when `initialData` is known to be defined.
134
+ * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to `useInfiniteQuery`, with `initialData` known to be defined.
134
135
  * @returns The same options object, typed so that `queryKey` carries the inferred data type.
135
136
  * @remarks See {@link useInfiniteQuery} for examples that fetch further pages, from a button click or
136
137
  * automatically as the user scrolls.
@@ -12,8 +12,9 @@ import type {
12
12
  import type { UseQueryOptions } from './types'
13
13
 
14
14
  /**
15
- * The options accepted by the `queryOptions` overload selected when no `initialData` is set — `data` may be
16
- * `undefined` while the query is `pending`.
15
+ * The options accepted by the `queryOptions` overload selected when `initialData` is omitted, may be
16
+ * `undefined`, or is a function that may return `undefined` — `data` may be `undefined` while the query is
17
+ * `pending`.
17
18
  * @template TQueryFnData - The type your `queryFn` resolves to.
18
19
  * @template TError - The type of errors your `queryFn` may throw.
19
20
  * @template TData - The type `data` ends up as after `select` runs.
@@ -39,8 +40,9 @@ export type UndefinedInitialDataOptions<
39
40
  }
40
41
 
41
42
  /**
42
- * The options accepted by the `queryOptions` overload selected when no `initialData` is set and `queryFn` is
43
- * not `skipToken` — same as {@link UndefinedInitialDataOptions}, but `queryFn` may not be `skipToken`.
43
+ * The options accepted by the `queryOptions` overload selected when `queryFn` is not `skipToken` and
44
+ * `initialData` is omitted, may be `undefined`, or is a function that may return `undefined` — same as
45
+ * {@link UndefinedInitialDataOptions}, but `queryFn` may not be `skipToken`.
44
46
  * @template TQueryFnData - The type your `queryFn` resolves to.
45
47
  * @template TError - The type of errors your `queryFn` may throw.
46
48
  * @template TData - The type `data` ends up as after `select` runs.
@@ -56,10 +58,11 @@ export type UnusedSkipTokenOptions<
56
58
  'queryFn'
57
59
  > & {
58
60
  /**
59
- * `skipToken` is not allowed as a value here — this overload is selected when no `initialData` is set. If
60
- * you don't intend to run the query yet, set `enabled: false` — omitting `queryFn` alone still triggers a
61
- * fetch that fails with "Missing queryFn" unless `enabled` is `false` or a default query function has been
62
- * defined. A default query function only supplies `queryFn`; it doesn't defer the fetch on its own.
61
+ * `skipToken` is not allowed as a value here — this overload is selected when `initialData` is omitted, may
62
+ * be `undefined`, or is a function that may return `undefined`. If you don't intend to run the query yet,
63
+ * set `enabled: false` — omitting `queryFn` alone still triggers a fetch that fails with "Missing queryFn"
64
+ * unless `enabled` is `false` or a default query function has been defined. A default query function only
65
+ * supplies `queryFn`; it doesn't defer the fetch on its own.
63
66
  */
64
67
  queryFn?: Exclude<
65
68
  UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>['queryFn'],
@@ -68,8 +71,8 @@ export type UnusedSkipTokenOptions<
68
71
  }
69
72
 
70
73
  /**
71
- * The options accepted by the `queryOptions` overload selected when `initialData` is set — `data` is never
72
- * `undefined` (unless a `select` changes `TData` to include `undefined`).
74
+ * The options accepted by the `queryOptions` overload selected when `initialData` is known to be defined —
75
+ * `data` is never `undefined` (unless a `select` changes `TData` to include `undefined`).
73
76
  * @template TQueryFnData - The type your `queryFn` resolves to.
74
77
  * @template TError - The type of errors your `queryFn` may throw.
75
78
  * @template TData - The type `data` ends up as after `select` runs.
@@ -104,9 +107,9 @@ export type DefinedInitialDataOptions<
104
107
  * be shared across hooks and imperative APIs such as `queryClient.query`. `options.queryKey` is required and
105
108
  * is the query key to generate options for.
106
109
  *
107
- * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless
108
- * a `select` changes `TData` to include `undefined`).
109
- * @param options - The {@link DefinedInitialDataOptions} to use — everything you can pass to `useQuery`, with `initialData` set.
110
+ * This overload is selected when `initialData` is known to be defined, so the resulting `data` is never
111
+ * `undefined` (unless a `select` changes `TData` to include `undefined`).
112
+ * @param options - The {@link DefinedInitialDataOptions} to use — everything you can pass to `useQuery`, with `initialData` known to be defined.
110
113
  * @returns The same options object, typed so that `queryKey` carries the inferred data type.
111
114
  * @see {@link useQuery} to run a query with these options.
112
115
  * @see [The Query Options API](https://tkdodo.eu/blog/the-query-options-api) for more on this pattern.
@@ -22,8 +22,8 @@ import type {
22
22
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
23
23
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
24
24
  *
25
- * This overload is selected when `initialData` is set.
26
- * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to `useInfiniteQuery`, with `initialData` set.
25
+ * This overload is selected when `initialData` is known to be defined.
26
+ * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to `useInfiniteQuery`, with `initialData` known to be defined.
27
27
  * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will
28
28
  * be used.
29
29
  * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,
@@ -39,7 +39,7 @@ import type { QueryClient, QueryFilters } from '@tanstack/query-core'
39
39
  * ```
40
40
  */
41
41
  export function useIsFetching(
42
- filters?: QueryFilters,
42
+ filters?: Omit<QueryFilters, 'fetchStatus'>,
43
43
  queryClient?: QueryClient,
44
44
  ): number {
45
45
  const client = useQueryClient(queryClient)
package/src/useQuery.ts CHANGED
@@ -13,9 +13,9 @@ import type {
13
13
  } from './types'
14
14
 
15
15
  /**
16
- * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless
17
- * a `select` changes `TData` to include `undefined`).
18
- * @param options - The {@link DefinedInitialDataOptions} to use — everything you can pass to `useQuery`, with `initialData` set.
16
+ * This overload is selected when `initialData` is known to be defined, so the resulting `data` is never
17
+ * `undefined` (unless a `select` changes `TData` to include `undefined`).
18
+ * @param options - The {@link DefinedInitialDataOptions} to use — everything you can pass to `useQuery`, with `initialData` known to be defined.
19
19
  * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will
20
20
  * be used.
21
21
  * @returns The current query result, typed so that `status` is `success` — or `error` if a fetch attempt
@@ -57,8 +57,8 @@ export function useQuery<
57
57
  ): DefinedUseQueryResult<TData, TError>
58
58
 
59
59
  /**
60
- * This overload is selected when `initialData` is omitted or may be `undefined`, so the resulting `data`
61
- * can be `undefined`.
60
+ * This overload is selected when `initialData` is omitted, may be `undefined`, or is a function that may
61
+ * return `undefined`, so the resulting `data` can be `undefined`.
62
62
  * @param options - The {@link UndefinedInitialDataOptions} to use — everything you can pass to `useQuery`.
63
63
  * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will
64
64
  * be used.