@tanstack/react-query 5.104.5 → 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 (301) hide show
  1. package/build/legacy/HydrationBoundary.cjs +2 -3
  2. package/build/legacy/HydrationBoundary.cjs.map +1 -1
  3. package/build/legacy/HydrationBoundary.d.cts +0 -2
  4. package/build/legacy/HydrationBoundary.d.cts.map +1 -1
  5. package/build/legacy/HydrationBoundary.d.ts +0 -2
  6. package/build/legacy/HydrationBoundary.d.ts.map +1 -1
  7. package/build/legacy/HydrationBoundary.js +1 -2
  8. package/build/legacy/HydrationBoundary.js.map +1 -1
  9. package/build/legacy/IsRestoringProvider.cjs +2 -3
  10. package/build/legacy/IsRestoringProvider.d.cts +0 -2
  11. package/build/legacy/IsRestoringProvider.d.cts.map +1 -1
  12. package/build/legacy/IsRestoringProvider.d.ts +0 -2
  13. package/build/legacy/IsRestoringProvider.d.ts.map +1 -1
  14. package/build/legacy/IsRestoringProvider.js +1 -2
  15. package/build/legacy/QueryClientProvider.cjs +2 -3
  16. package/build/legacy/QueryClientProvider.d.cts +0 -2
  17. package/build/legacy/QueryClientProvider.d.cts.map +1 -1
  18. package/build/legacy/QueryClientProvider.d.ts +0 -2
  19. package/build/legacy/QueryClientProvider.d.ts.map +1 -1
  20. package/build/legacy/QueryClientProvider.js +1 -2
  21. package/build/legacy/QueryErrorResetBoundary.cjs +2 -3
  22. package/build/legacy/QueryErrorResetBoundary.d.cts +1 -3
  23. package/build/legacy/QueryErrorResetBoundary.d.cts.map +1 -1
  24. package/build/legacy/QueryErrorResetBoundary.d.ts +1 -3
  25. package/build/legacy/QueryErrorResetBoundary.d.ts.map +1 -1
  26. package/build/legacy/QueryErrorResetBoundary.js +1 -2
  27. package/build/legacy/errorBoundaryUtils.cjs +2 -3
  28. package/build/legacy/errorBoundaryUtils.d.cts +0 -2
  29. package/build/legacy/errorBoundaryUtils.d.cts.map +1 -1
  30. package/build/legacy/errorBoundaryUtils.d.ts +0 -2
  31. package/build/legacy/errorBoundaryUtils.d.ts.map +1 -1
  32. package/build/legacy/errorBoundaryUtils.js +1 -2
  33. package/build/legacy/index.cjs +1 -2
  34. package/build/legacy/index.js +1 -2
  35. package/build/legacy/infiniteQueryOptions.cjs +1 -2
  36. package/build/legacy/infiniteQueryOptions.cjs.map +1 -1
  37. package/build/legacy/infiniteQueryOptions.d.cts +16 -16
  38. package/build/legacy/infiniteQueryOptions.d.cts.map +1 -1
  39. package/build/legacy/infiniteQueryOptions.d.ts +16 -16
  40. package/build/legacy/infiniteQueryOptions.d.ts.map +1 -1
  41. package/build/legacy/infiniteQueryOptions.js +1 -2
  42. package/build/legacy/infiniteQueryOptions.js.map +1 -1
  43. package/build/legacy/mutationOptions.cjs +1 -2
  44. package/build/legacy/mutationOptions.d.cts +0 -2
  45. package/build/legacy/mutationOptions.d.cts.map +1 -1
  46. package/build/legacy/mutationOptions.d.ts +0 -2
  47. package/build/legacy/mutationOptions.d.ts.map +1 -1
  48. package/build/legacy/mutationOptions.js +1 -2
  49. package/build/legacy/queryOptions.cjs +1 -2
  50. package/build/legacy/queryOptions.cjs.map +1 -1
  51. package/build/legacy/queryOptions.d.cts +16 -15
  52. package/build/legacy/queryOptions.d.cts.map +1 -1
  53. package/build/legacy/queryOptions.d.ts +16 -15
  54. package/build/legacy/queryOptions.d.ts.map +1 -1
  55. package/build/legacy/queryOptions.js +1 -2
  56. package/build/legacy/queryOptions.js.map +1 -1
  57. package/build/legacy/{rolldown-runtime-VH7oDXx4.cjs → rolldown-runtime-CmQyd0Gu.cjs} +1 -2
  58. package/build/legacy/suspense.cjs +1 -2
  59. package/build/legacy/suspense.d.cts +0 -2
  60. package/build/legacy/suspense.d.cts.map +1 -1
  61. package/build/legacy/suspense.d.ts +0 -2
  62. package/build/legacy/suspense.d.ts.map +1 -1
  63. package/build/legacy/suspense.js +1 -2
  64. package/build/legacy/types.cjs +1 -2
  65. package/build/legacy/types.d.cts +0 -2
  66. package/build/legacy/types.d.cts.map +1 -1
  67. package/build/legacy/types.d.ts +0 -2
  68. package/build/legacy/types.d.ts.map +1 -1
  69. package/build/legacy/types.js +1 -2
  70. package/build/legacy/useBaseQuery.cjs +2 -3
  71. package/build/legacy/useBaseQuery.d.cts +0 -2
  72. package/build/legacy/useBaseQuery.d.cts.map +1 -1
  73. package/build/legacy/useBaseQuery.d.ts +0 -2
  74. package/build/legacy/useBaseQuery.d.ts.map +1 -1
  75. package/build/legacy/useBaseQuery.js +1 -2
  76. package/build/legacy/useInfiniteQuery.cjs +1 -2
  77. package/build/legacy/useInfiniteQuery.cjs.map +1 -1
  78. package/build/legacy/useInfiniteQuery.d.cts +2 -4
  79. package/build/legacy/useInfiniteQuery.d.cts.map +1 -1
  80. package/build/legacy/useInfiniteQuery.d.ts +2 -4
  81. package/build/legacy/useInfiniteQuery.d.ts.map +1 -1
  82. package/build/legacy/useInfiniteQuery.js +1 -2
  83. package/build/legacy/useInfiniteQuery.js.map +1 -1
  84. package/build/legacy/useIsFetching.cjs +2 -3
  85. package/build/legacy/useIsFetching.cjs.map +1 -1
  86. package/build/legacy/useIsFetching.d.cts +1 -3
  87. package/build/legacy/useIsFetching.d.cts.map +1 -1
  88. package/build/legacy/useIsFetching.d.ts +1 -3
  89. package/build/legacy/useIsFetching.d.ts.map +1 -1
  90. package/build/legacy/useIsFetching.js +1 -2
  91. package/build/legacy/useIsFetching.js.map +1 -1
  92. package/build/legacy/useMutation.cjs +2 -3
  93. package/build/legacy/useMutation.d.cts +0 -2
  94. package/build/legacy/useMutation.d.cts.map +1 -1
  95. package/build/legacy/useMutation.d.ts +0 -2
  96. package/build/legacy/useMutation.d.ts.map +1 -1
  97. package/build/legacy/useMutation.js +1 -2
  98. package/build/legacy/useMutationState.cjs +2 -3
  99. package/build/legacy/useMutationState.d.cts +0 -2
  100. package/build/legacy/useMutationState.d.cts.map +1 -1
  101. package/build/legacy/useMutationState.d.ts +0 -2
  102. package/build/legacy/useMutationState.d.ts.map +1 -1
  103. package/build/legacy/useMutationState.js +1 -2
  104. package/build/legacy/usePrefetchInfiniteQuery.cjs +1 -2
  105. package/build/legacy/usePrefetchInfiniteQuery.d.cts +0 -2
  106. package/build/legacy/usePrefetchInfiniteQuery.d.cts.map +1 -1
  107. package/build/legacy/usePrefetchInfiniteQuery.d.ts +0 -2
  108. package/build/legacy/usePrefetchInfiniteQuery.d.ts.map +1 -1
  109. package/build/legacy/usePrefetchInfiniteQuery.js +1 -2
  110. package/build/legacy/usePrefetchQuery.cjs +1 -2
  111. package/build/legacy/usePrefetchQuery.d.cts +0 -2
  112. package/build/legacy/usePrefetchQuery.d.cts.map +1 -1
  113. package/build/legacy/usePrefetchQuery.d.ts +0 -2
  114. package/build/legacy/usePrefetchQuery.d.ts.map +1 -1
  115. package/build/legacy/usePrefetchQuery.js +1 -2
  116. package/build/legacy/useQueries.cjs +2 -3
  117. package/build/legacy/useQueries.d.cts +0 -2
  118. package/build/legacy/useQueries.d.cts.map +1 -1
  119. package/build/legacy/useQueries.d.ts +0 -2
  120. package/build/legacy/useQueries.d.ts.map +1 -1
  121. package/build/legacy/useQueries.js +1 -2
  122. package/build/legacy/useQuery.cjs +1 -2
  123. package/build/legacy/useQuery.cjs.map +1 -1
  124. package/build/legacy/useQuery.d.cts +5 -7
  125. package/build/legacy/useQuery.d.cts.map +1 -1
  126. package/build/legacy/useQuery.d.ts +5 -7
  127. package/build/legacy/useQuery.d.ts.map +1 -1
  128. package/build/legacy/useQuery.js +1 -2
  129. package/build/legacy/useQuery.js.map +1 -1
  130. package/build/legacy/useSuspenseInfiniteQuery.cjs +1 -2
  131. package/build/legacy/useSuspenseInfiniteQuery.d.cts +0 -2
  132. package/build/legacy/useSuspenseInfiniteQuery.d.cts.map +1 -1
  133. package/build/legacy/useSuspenseInfiniteQuery.d.ts +0 -2
  134. package/build/legacy/useSuspenseInfiniteQuery.d.ts.map +1 -1
  135. package/build/legacy/useSuspenseInfiniteQuery.js +1 -2
  136. package/build/legacy/useSuspenseQueries.cjs +1 -2
  137. package/build/legacy/useSuspenseQueries.d.cts +0 -2
  138. package/build/legacy/useSuspenseQueries.d.cts.map +1 -1
  139. package/build/legacy/useSuspenseQueries.d.ts +0 -2
  140. package/build/legacy/useSuspenseQueries.d.ts.map +1 -1
  141. package/build/legacy/useSuspenseQueries.js +1 -2
  142. package/build/legacy/useSuspenseQuery.cjs +1 -2
  143. package/build/legacy/useSuspenseQuery.d.cts +0 -2
  144. package/build/legacy/useSuspenseQuery.d.cts.map +1 -1
  145. package/build/legacy/useSuspenseQuery.d.ts +0 -2
  146. package/build/legacy/useSuspenseQuery.d.ts.map +1 -1
  147. package/build/legacy/useSuspenseQuery.js +1 -2
  148. package/build/modern/HydrationBoundary.cjs +2 -3
  149. package/build/modern/HydrationBoundary.cjs.map +1 -1
  150. package/build/modern/HydrationBoundary.d.cts +0 -2
  151. package/build/modern/HydrationBoundary.d.cts.map +1 -1
  152. package/build/modern/HydrationBoundary.d.ts +0 -2
  153. package/build/modern/HydrationBoundary.d.ts.map +1 -1
  154. package/build/modern/HydrationBoundary.js +1 -2
  155. package/build/modern/HydrationBoundary.js.map +1 -1
  156. package/build/modern/IsRestoringProvider.cjs +2 -3
  157. package/build/modern/IsRestoringProvider.d.cts +0 -2
  158. package/build/modern/IsRestoringProvider.d.cts.map +1 -1
  159. package/build/modern/IsRestoringProvider.d.ts +0 -2
  160. package/build/modern/IsRestoringProvider.d.ts.map +1 -1
  161. package/build/modern/IsRestoringProvider.js +1 -2
  162. package/build/modern/QueryClientProvider.cjs +2 -3
  163. package/build/modern/QueryClientProvider.d.cts +0 -2
  164. package/build/modern/QueryClientProvider.d.cts.map +1 -1
  165. package/build/modern/QueryClientProvider.d.ts +0 -2
  166. package/build/modern/QueryClientProvider.d.ts.map +1 -1
  167. package/build/modern/QueryClientProvider.js +1 -2
  168. package/build/modern/QueryErrorResetBoundary.cjs +2 -3
  169. package/build/modern/QueryErrorResetBoundary.d.cts +1 -3
  170. package/build/modern/QueryErrorResetBoundary.d.cts.map +1 -1
  171. package/build/modern/QueryErrorResetBoundary.d.ts +1 -3
  172. package/build/modern/QueryErrorResetBoundary.d.ts.map +1 -1
  173. package/build/modern/QueryErrorResetBoundary.js +1 -2
  174. package/build/modern/errorBoundaryUtils.cjs +2 -3
  175. package/build/modern/errorBoundaryUtils.d.cts +0 -2
  176. package/build/modern/errorBoundaryUtils.d.cts.map +1 -1
  177. package/build/modern/errorBoundaryUtils.d.ts +0 -2
  178. package/build/modern/errorBoundaryUtils.d.ts.map +1 -1
  179. package/build/modern/errorBoundaryUtils.js +1 -2
  180. package/build/modern/index.cjs +1 -2
  181. package/build/modern/index.js +1 -2
  182. package/build/modern/infiniteQueryOptions.cjs +1 -2
  183. package/build/modern/infiniteQueryOptions.cjs.map +1 -1
  184. package/build/modern/infiniteQueryOptions.d.cts +16 -16
  185. package/build/modern/infiniteQueryOptions.d.cts.map +1 -1
  186. package/build/modern/infiniteQueryOptions.d.ts +16 -16
  187. package/build/modern/infiniteQueryOptions.d.ts.map +1 -1
  188. package/build/modern/infiniteQueryOptions.js +1 -2
  189. package/build/modern/infiniteQueryOptions.js.map +1 -1
  190. package/build/modern/mutationOptions.cjs +1 -2
  191. package/build/modern/mutationOptions.d.cts +0 -2
  192. package/build/modern/mutationOptions.d.cts.map +1 -1
  193. package/build/modern/mutationOptions.d.ts +0 -2
  194. package/build/modern/mutationOptions.d.ts.map +1 -1
  195. package/build/modern/mutationOptions.js +1 -2
  196. package/build/modern/queryOptions.cjs +1 -2
  197. package/build/modern/queryOptions.cjs.map +1 -1
  198. package/build/modern/queryOptions.d.cts +16 -15
  199. package/build/modern/queryOptions.d.cts.map +1 -1
  200. package/build/modern/queryOptions.d.ts +16 -15
  201. package/build/modern/queryOptions.d.ts.map +1 -1
  202. package/build/modern/queryOptions.js +1 -2
  203. package/build/modern/queryOptions.js.map +1 -1
  204. package/build/modern/{rolldown-runtime-VH7oDXx4.cjs → rolldown-runtime-CmQyd0Gu.cjs} +1 -2
  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 +2 -3
  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 +2 -3
  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 +2 -3
  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 +2 -3
  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 +2 -3
  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/package.json +8 -8
  296. package/src/HydrationBoundary.tsx +1 -1
  297. package/src/infiniteQueryOptions.ts +15 -14
  298. package/src/queryOptions.ts +16 -13
  299. package/src/useInfiniteQuery.ts +2 -2
  300. package/src/useIsFetching.ts +1 -1
  301. package/src/useQuery.ts +5 -5
@@ -2,7 +2,7 @@
2
2
  import { useQueryClient } from "./QueryClientProvider.js";
3
3
  import * as React from "react";
4
4
  import { notifyManager } from "@tanstack/query-core";
5
- //#region src/useIsFetching.ts
5
+ // src/useIsFetching.ts
6
6
  /**
7
7
  * The `useIsFetching` hook returns the `number` of the queries that your application is loading or fetching in
8
8
  * the background (useful for app-wide loading indicators).
@@ -41,7 +41,6 @@ function useIsFetching(filters, queryClient) {
41
41
  const queryCache = client.getQueryCache();
42
42
  return React.useSyncExternalStore(React.useCallback((onStoreChange) => queryCache.subscribe(notifyManager.batchCalls(onStoreChange)), [queryCache]), () => client.isFetching(filters), () => client.isFetching(filters));
43
43
  }
44
- //#endregion
45
44
  export { useIsFetching };
46
45
 
47
46
  //# sourceMappingURL=useIsFetching.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIsFetching.js","names":[],"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\n/**\n * The `useIsFetching` hook returns the `number` of the queries that your application is loading or fetching in\n * the background (useful for app-wide loading indicators).\n * @param filters - The {@link QueryFilters} to narrow down the matched queries.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n * be used.\n * @returns Will be the `number` of the queries that your application is currently loading or fetching in the\n * background.\n * @example\n * ```tsx\n * import { useIsFetching } from '@tanstack/react-query'\n *\n * function PostsFetchingIndicator() {\n * // How many queries matching the posts prefix are fetching?\n * const isFetchingPosts = useIsFetching({ queryKey: ['posts'] })\n *\n * return isFetchingPosts ? <span>Refreshing posts...</span> : null\n * }\n * ```\n * @example\n * A global loading indicator for any query fetching in the background, not just the ones on screen:\n * ```tsx\n * import { useIsFetching } from '@tanstack/react-query'\n *\n * function GlobalLoadingIndicator() {\n * const isFetching = useIsFetching()\n *\n * return isFetching ? (\n * <div>Queries are fetching in the background...</div>\n * ) : null\n * }\n * ```\n */\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAgB,cACd,SACA,aACQ;CACR,MAAM,SAAS,eAAe,WAAW;CACzC,MAAM,aAAa,OAAO,cAAc;CAExC,OAAO,MAAM,qBACX,MAAM,aACH,kBACC,WAAW,UAAU,cAAc,WAAW,aAAa,CAAC,GAC9D,CAAC,UAAU,CACb,SACM,OAAO,WAAW,OAAO,SACzB,OAAO,WAAW,OAAO,CACjC;AACF"}
1
+ {"version":3,"file":"useIsFetching.js","names":[],"sources":["../../src/useIsFetching.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\n/**\n * The `useIsFetching` hook returns the `number` of the queries that your application is loading or fetching in\n * the background (useful for app-wide loading indicators).\n * @param filters - The {@link QueryFilters} to narrow down the matched queries.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n * be used.\n * @returns Will be the `number` of the queries that your application is currently loading or fetching in the\n * background.\n * @example\n * ```tsx\n * import { useIsFetching } from '@tanstack/react-query'\n *\n * function PostsFetchingIndicator() {\n * // How many queries matching the posts prefix are fetching?\n * const isFetchingPosts = useIsFetching({ queryKey: ['posts'] })\n *\n * return isFetchingPosts ? <span>Refreshing posts...</span> : null\n * }\n * ```\n * @example\n * A global loading indicator for any query fetching in the background, not just the ones on screen:\n * ```tsx\n * import { useIsFetching } from '@tanstack/react-query'\n *\n * function GlobalLoadingIndicator() {\n * const isFetching = useIsFetching()\n *\n * return isFetching ? (\n * <div>Queries are fetching in the background...</div>\n * ) : null\n * }\n * ```\n */\nexport function useIsFetching(\n filters?: Omit<QueryFilters, 'fetchStatus'>,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAgB,cACd,SACA,aACQ;CACR,MAAM,SAAS,eAAe,WAAW;CACzC,MAAM,aAAa,OAAO,cAAc;CAExC,OAAO,MAAM,qBACX,MAAM,aACH,kBACC,WAAW,UAAU,cAAc,WAAW,aAAa,CAAC,GAC9D,CAAC,UAAU,CACb,SACM,OAAO,WAAW,OAAO,SACzB,OAAO,WAAW,OAAO,CACjC;AACF"}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
3
+ const require_rolldown_runtime = require("./rolldown-runtime-CmQyd0Gu.cjs");
4
4
  const require_QueryClientProvider = require("./QueryClientProvider.cjs");
5
5
  let react = require("react");
6
6
  react = require_rolldown_runtime.__toESM(react, 1);
7
7
  let _tanstack_query_core = require("@tanstack/query-core");
8
- //#region src/useMutation.ts
8
+ // src/useMutation.ts
9
9
  /**
10
10
  * Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects.
11
11
  * `useMutation` is the hook for that.
@@ -191,7 +191,6 @@ function useMutation(options, queryClient) {
191
191
  mutateAsync: result.mutate
192
192
  };
193
193
  }
194
- //#endregion
195
194
  exports.useMutation = useMutation;
196
195
 
197
196
  //# sourceMappingURL=useMutation.cjs.map
@@ -1,6 +1,5 @@
1
1
  import { UseMutationOptions, UseMutationResult } from "./types.cjs";
2
2
  import { DefaultError, QueryClient } from "@tanstack/query-core";
3
- //#region src/useMutation.d.ts
4
3
  /**
5
4
  * Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects.
6
5
  * `useMutation` is the hook for that.
@@ -170,5 +169,4 @@ import { DefaultError, QueryClient } from "@tanstack/query-core";
170
169
  * ```
171
170
  */
172
171
  export declare function useMutation<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: UseMutationOptions<TData, TError, TVariables, TOnMutateResult>, queryClient?: QueryClient): UseMutationResult<TData, TError, TVariables, TOnMutateResult>;
173
- //#endregion
174
172
  //# sourceMappingURL=useMutation.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMutation.d.cts","names":[],"sources":["../../src/useMutation.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0LgB,YACd,iBACA,SAAS,cACT,mBACA,2BAEA,SAAS,mBAAmB,OAAO,QAAQ,YAAY,kBACvD,cAAc,cACb,kBAAkB,OAAO,QAAQ,YAAY"}
1
+ {"version":3,"file":"useMutation.d.cts","names":[],"sources":["../../src/useMutation.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0LgB,YACd,iBACA,SAAS,cACT,mBACA,2BAEA,SAAS,mBAAmB,OAAO,QAAQ,YAAY,kBACvD,cAAc,cACb,kBAAkB,OAAO,QAAQ,YAAY"}
@@ -1,6 +1,5 @@
1
1
  import { UseMutationOptions, UseMutationResult } from "./types.js";
2
2
  import { DefaultError, QueryClient } from "@tanstack/query-core";
3
- //#region src/useMutation.d.ts
4
3
  /**
5
4
  * Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects.
6
5
  * `useMutation` is the hook for that.
@@ -170,5 +169,4 @@ import { DefaultError, QueryClient } from "@tanstack/query-core";
170
169
  * ```
171
170
  */
172
171
  export declare function useMutation<TData = unknown, TError = DefaultError, TVariables = void, TOnMutateResult = unknown>(options: UseMutationOptions<TData, TError, TVariables, TOnMutateResult>, queryClient?: QueryClient): UseMutationResult<TData, TError, TVariables, TOnMutateResult>;
173
- //#endregion
174
172
  //# sourceMappingURL=useMutation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMutation.d.ts","names":[],"sources":["../../src/useMutation.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0LgB,YACd,iBACA,SAAS,cACT,mBACA,2BAEA,SAAS,mBAAmB,OAAO,QAAQ,YAAY,kBACvD,cAAc,cACb,kBAAkB,OAAO,QAAQ,YAAY"}
1
+ {"version":3,"file":"useMutation.d.ts","names":[],"sources":["../../src/useMutation.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0LgB,YACd,iBACA,SAAS,cACT,mBACA,2BAEA,SAAS,mBAAmB,OAAO,QAAQ,YAAY,kBACvD,cAAc,cACb,kBAAkB,OAAO,QAAQ,YAAY"}
@@ -2,7 +2,7 @@
2
2
  import { useQueryClient } from "./QueryClientProvider.js";
3
3
  import * as React from "react";
4
4
  import { MutationObserver, noop, notifyManager, shouldThrowError } from "@tanstack/query-core";
5
- //#region src/useMutation.ts
5
+ // src/useMutation.ts
6
6
  /**
7
7
  * Unlike queries, mutations are typically used to create/update/delete data or perform server side-effects.
8
8
  * `useMutation` is the hook for that.
@@ -188,7 +188,6 @@ function useMutation(options, queryClient) {
188
188
  mutateAsync: result.mutate
189
189
  };
190
190
  }
191
- //#endregion
192
191
  export { useMutation };
193
192
 
194
193
  //# sourceMappingURL=useMutation.js.map
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
3
+ const require_rolldown_runtime = require("./rolldown-runtime-CmQyd0Gu.cjs");
4
4
  const require_QueryClientProvider = require("./QueryClientProvider.cjs");
5
5
  let react = require("react");
6
6
  react = require_rolldown_runtime.__toESM(react, 1);
7
7
  let _tanstack_query_core = require("@tanstack/query-core");
8
- //#region src/useMutationState.ts
8
+ // src/useMutationState.ts
9
9
  /**
10
10
  * The `useIsMutating` hook returns the `number` of mutations that your application currently has `pending`
11
11
  * (useful for app-wide loading indicators).
@@ -130,7 +130,6 @@ function useMutationState(options = {}, queryClient) {
130
130
  const getSnapshot = createSnapshot(mutationCache, options);
131
131
  return react.useSyncExternalStore(react.useCallback((onStoreChange) => mutationCache.subscribe(_tanstack_query_core.notifyManager.batchCalls(onStoreChange)), [mutationCache]), getSnapshot, getSnapshot);
132
132
  }
133
- //#endregion
134
133
  exports.useIsMutating = useIsMutating;
135
134
  exports.useMutationState = useMutationState;
136
135
 
@@ -1,5 +1,4 @@
1
1
  import { Mutation, MutationFilters, MutationState, QueryClient } from "@tanstack/query-core";
2
- //#region src/useMutationState.d.ts
3
2
  /**
4
3
  * The `useIsMutating` hook returns the `number` of mutations that your application currently has `pending`
5
4
  * (useful for app-wide loading indicators).
@@ -95,5 +94,4 @@ type MutationStateOptions<TResult = MutationState, TMutation extends Mutation<an
95
94
  * ```
96
95
  */
97
96
  export declare function useMutationState<TResult = MutationState, TMutation extends Mutation<any, any, any, any> = MutationTypeFromResult<TResult>>(options?: MutationStateOptions<TResult, TMutation>, queryClient?: QueryClient): Array<TResult>;
98
- //#endregion
99
97
  //# sourceMappingURL=useMutationState.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMutationState.d.cts","names":[],"sources":["../../src/useMutationState.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;wBAgCgB,cACd,UAAU,iBACV,cAAc;KASX,uBAAuB,YAAY,kBACtC,oBACQ,aACA,cACA,kBACA,oBAGN,SAAS,OAAO,QAAQ,YAAY,mBACpC;KAEC,qBACH,UAAU,eACV,kBAAkB,+BAChB,uBAAuB;EAEzB,UAAU;EACV,UAAU,UAAU,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0HpB,iBACd,UAAU,eACV,kBAAkB,+BAChB,uBAAuB,UAEzB,UAAS,qBAAqB,SAAS,YACvC,cAAc,cACb,MAAM"}
1
+ {"version":3,"file":"useMutationState.d.cts","names":[],"sources":["../../src/useMutationState.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBAgCgB,cACd,UAAU,iBACV,cAAc;KASX,uBAAuB,YAAY,kBACtC,oBACQ,aACA,cACA,kBACA,oBAGN,SAAS,OAAO,QAAQ,YAAY,mBACpC;KAEC,qBACH,UAAU,eACV,kBAAkB,+BAChB,uBAAuB;EAEzB,UAAU;EACV,UAAU,UAAU,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0HpB,iBACd,UAAU,eACV,kBAAkB,+BAChB,uBAAuB,UAEzB,UAAS,qBAAqB,SAAS,YACvC,cAAc,cACb,MAAM"}
@@ -1,5 +1,4 @@
1
1
  import { Mutation, MutationFilters, MutationState, QueryClient } from "@tanstack/query-core";
2
- //#region src/useMutationState.d.ts
3
2
  /**
4
3
  * The `useIsMutating` hook returns the `number` of mutations that your application currently has `pending`
5
4
  * (useful for app-wide loading indicators).
@@ -95,5 +94,4 @@ type MutationStateOptions<TResult = MutationState, TMutation extends Mutation<an
95
94
  * ```
96
95
  */
97
96
  export declare function useMutationState<TResult = MutationState, TMutation extends Mutation<any, any, any, any> = MutationTypeFromResult<TResult>>(options?: MutationStateOptions<TResult, TMutation>, queryClient?: QueryClient): Array<TResult>;
98
- //#endregion
99
97
  //# sourceMappingURL=useMutationState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMutationState.d.ts","names":[],"sources":["../../src/useMutationState.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;wBAgCgB,cACd,UAAU,iBACV,cAAc;KASX,uBAAuB,YAAY,kBACtC,oBACQ,aACA,cACA,kBACA,oBAGN,SAAS,OAAO,QAAQ,YAAY,mBACpC;KAEC,qBACH,UAAU,eACV,kBAAkB,+BAChB,uBAAuB;EAEzB,UAAU;EACV,UAAU,UAAU,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0HpB,iBACd,UAAU,eACV,kBAAkB,+BAChB,uBAAuB,UAEzB,UAAS,qBAAqB,SAAS,YACvC,cAAc,cACb,MAAM"}
1
+ {"version":3,"file":"useMutationState.d.ts","names":[],"sources":["../../src/useMutationState.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBAgCgB,cACd,UAAU,iBACV,cAAc;KASX,uBAAuB,YAAY,kBACtC,oBACQ,aACA,cACA,kBACA,oBAGN,SAAS,OAAO,QAAQ,YAAY,mBACpC;KAEC,qBACH,UAAU,eACV,kBAAkB,+BAChB,uBAAuB;EAEzB,UAAU;EACV,UAAU,UAAU,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0HpB,iBACd,UAAU,eACV,kBAAkB,+BAChB,uBAAuB,UAEzB,UAAS,qBAAqB,SAAS,YACvC,cAAc,cACb,MAAM"}
@@ -2,7 +2,7 @@
2
2
  import { useQueryClient } from "./QueryClientProvider.js";
3
3
  import * as React from "react";
4
4
  import { notifyManager, replaceEqualDeep } from "@tanstack/query-core";
5
- //#region src/useMutationState.ts
5
+ // src/useMutationState.ts
6
6
  /**
7
7
  * The `useIsMutating` hook returns the `number` of mutations that your application currently has `pending`
8
8
  * (useful for app-wide loading indicators).
@@ -127,7 +127,6 @@ function useMutationState(options = {}, queryClient) {
127
127
  const getSnapshot = createSnapshot(mutationCache, options);
128
128
  return React.useSyncExternalStore(React.useCallback((onStoreChange) => mutationCache.subscribe(notifyManager.batchCalls(onStoreChange)), [mutationCache]), getSnapshot, getSnapshot);
129
129
  }
130
- //#endregion
131
130
  export { useIsMutating, useMutationState };
132
131
 
133
132
  //# sourceMappingURL=useMutationState.js.map
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_QueryClientProvider = require("./QueryClientProvider.cjs");
3
3
  let _tanstack_query_core = require("@tanstack/query-core");
4
- //#region src/usePrefetchInfiniteQuery.tsx
4
+ // src/usePrefetchInfiniteQuery.tsx
5
5
  /**
6
6
  * `usePrefetchInfiniteQuery` does not return anything, it should be used just to fire a prefetch during render,
7
7
  * before a suspense boundary that wraps a component that uses `useSuspenseInfiniteQuery`. You can pass
@@ -47,7 +47,6 @@ function usePrefetchInfiniteQuery(options, queryClient) {
47
47
  const client = require_QueryClientProvider.useQueryClient(queryClient);
48
48
  if (!client.getQueryState(options.queryKey)) client.infiniteQuery(options).catch(_tanstack_query_core.noop);
49
49
  }
50
- //#endregion
51
50
  exports.usePrefetchInfiniteQuery = usePrefetchInfiniteQuery;
52
51
 
53
52
  //# sourceMappingURL=usePrefetchInfiniteQuery.cjs.map
@@ -1,6 +1,5 @@
1
1
  import { UsePrefetchInfiniteQueryOptions } from "./types.cjs";
2
2
  import { DefaultError, InfiniteData, QueryClient, QueryKey } from "@tanstack/query-core";
3
- //#region src/usePrefetchInfiniteQuery.d.ts
4
3
  /**
5
4
  * `usePrefetchInfiniteQuery` does not return anything, it should be used just to fire a prefetch during render,
6
5
  * before a suspense boundary that wraps a component that uses `useSuspenseInfiniteQuery`. You can pass
@@ -43,5 +42,4 @@ import { DefaultError, InfiniteData, QueryClient, QueryKey } from "@tanstack/que
43
42
  * ```
44
43
  */
45
44
  export declare function usePrefetchInfiniteQuery<TQueryFnData = unknown, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UsePrefetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, queryClient?: QueryClient): void;
46
- //#endregion
47
45
  //# sourceMappingURL=usePrefetchInfiniteQuery.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePrefetchInfiniteQuery.d.cts","names":[],"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoDgB,yBACd,wBACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,gCACP,cACA,QACA,OACA,WACA,aAEF,cAAc"}
1
+ {"version":3,"file":"usePrefetchInfiniteQuery.d.cts","names":[],"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoDgB,yBACd,wBACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,gCACP,cACA,QACA,OACA,WACA,aAEF,cAAc"}
@@ -1,6 +1,5 @@
1
1
  import { UsePrefetchInfiniteQueryOptions } from "./types.js";
2
2
  import { DefaultError, InfiniteData, QueryClient, QueryKey } from "@tanstack/query-core";
3
- //#region src/usePrefetchInfiniteQuery.d.ts
4
3
  /**
5
4
  * `usePrefetchInfiniteQuery` does not return anything, it should be used just to fire a prefetch during render,
6
5
  * before a suspense boundary that wraps a component that uses `useSuspenseInfiniteQuery`. You can pass
@@ -43,5 +42,4 @@ import { DefaultError, InfiniteData, QueryClient, QueryKey } from "@tanstack/que
43
42
  * ```
44
43
  */
45
44
  export declare function usePrefetchInfiniteQuery<TQueryFnData = unknown, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UsePrefetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, queryClient?: QueryClient): void;
46
- //#endregion
47
45
  //# sourceMappingURL=usePrefetchInfiniteQuery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePrefetchInfiniteQuery.d.ts","names":[],"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoDgB,yBACd,wBACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,gCACP,cACA,QACA,OACA,WACA,aAEF,cAAc"}
1
+ {"version":3,"file":"usePrefetchInfiniteQuery.d.ts","names":[],"sources":["../../src/usePrefetchInfiniteQuery.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAoDgB,yBACd,wBACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,gCACP,cACA,QACA,OACA,WACA,aAEF,cAAc"}
@@ -1,6 +1,6 @@
1
1
  import { useQueryClient } from "./QueryClientProvider.js";
2
2
  import { noop } from "@tanstack/query-core";
3
- //#region src/usePrefetchInfiniteQuery.tsx
3
+ // src/usePrefetchInfiniteQuery.tsx
4
4
  /**
5
5
  * `usePrefetchInfiniteQuery` does not return anything, it should be used just to fire a prefetch during render,
6
6
  * before a suspense boundary that wraps a component that uses `useSuspenseInfiniteQuery`. You can pass
@@ -46,7 +46,6 @@ function usePrefetchInfiniteQuery(options, queryClient) {
46
46
  const client = useQueryClient(queryClient);
47
47
  if (!client.getQueryState(options.queryKey)) client.infiniteQuery(options).catch(noop);
48
48
  }
49
- //#endregion
50
49
  export { usePrefetchInfiniteQuery };
51
50
 
52
51
  //# sourceMappingURL=usePrefetchInfiniteQuery.js.map
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_QueryClientProvider = require("./QueryClientProvider.cjs");
3
3
  let _tanstack_query_core = require("@tanstack/query-core");
4
- //#region src/usePrefetchQuery.tsx
4
+ // src/usePrefetchQuery.tsx
5
5
  /**
6
6
  * `usePrefetchQuery` does not return anything, it should be used just to fire a prefetch during render, before
7
7
  * a suspense boundary that wraps a component that uses `useSuspenseQuery`. You can pass everything to
@@ -38,7 +38,6 @@ function usePrefetchQuery(options, queryClient) {
38
38
  const client = require_QueryClientProvider.useQueryClient(queryClient);
39
39
  if (!client.getQueryState(options.queryKey)) client.query(options).catch(_tanstack_query_core.noop);
40
40
  }
41
- //#endregion
42
41
  exports.usePrefetchQuery = usePrefetchQuery;
43
42
 
44
43
  //# sourceMappingURL=usePrefetchQuery.cjs.map
@@ -1,6 +1,5 @@
1
1
  import { UsePrefetchQueryOptions } from "./types.cjs";
2
2
  import { DefaultError, QueryClient, QueryKey } from "@tanstack/query-core";
3
- //#region src/usePrefetchQuery.d.ts
4
3
  /**
5
4
  * `usePrefetchQuery` does not return anything, it should be used just to fire a prefetch during render, before
6
5
  * a suspense boundary that wraps a component that uses `useSuspenseQuery`. You can pass everything to
@@ -34,5 +33,4 @@ import { DefaultError, QueryClient, QueryKey } from "@tanstack/query-core";
34
33
  * ```
35
34
  */
36
35
  export declare function usePrefetchQuery<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UsePrefetchQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, queryClient?: QueryClient): void;
37
- //#endregion
38
36
  //# sourceMappingURL=usePrefetchQuery.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePrefetchQuery.d.cts","names":[],"sources":["../../src/usePrefetchQuery.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsCgB,iBACd,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cACb,kBAAkB,WAAW,UAE7B,SAAS,wBACP,cACA,QACA,OACA,YACA,YAEF,cAAc"}
1
+ {"version":3,"file":"usePrefetchQuery.d.cts","names":[],"sources":["../../src/usePrefetchQuery.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsCgB,iBACd,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cACb,kBAAkB,WAAW,UAE7B,SAAS,wBACP,cACA,QACA,OACA,YACA,YAEF,cAAc"}
@@ -1,6 +1,5 @@
1
1
  import { UsePrefetchQueryOptions } from "./types.js";
2
2
  import { DefaultError, QueryClient, QueryKey } from "@tanstack/query-core";
3
- //#region src/usePrefetchQuery.d.ts
4
3
  /**
5
4
  * `usePrefetchQuery` does not return anything, it should be used just to fire a prefetch during render, before
6
5
  * a suspense boundary that wraps a component that uses `useSuspenseQuery`. You can pass everything to
@@ -34,5 +33,4 @@ import { DefaultError, QueryClient, QueryKey } from "@tanstack/query-core";
34
33
  * ```
35
34
  */
36
35
  export declare function usePrefetchQuery<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UsePrefetchQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, queryClient?: QueryClient): void;
37
- //#endregion
38
36
  //# sourceMappingURL=usePrefetchQuery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePrefetchQuery.d.ts","names":[],"sources":["../../src/usePrefetchQuery.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsCgB,iBACd,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cACb,kBAAkB,WAAW,UAE7B,SAAS,wBACP,cACA,QACA,OACA,YACA,YAEF,cAAc"}
1
+ {"version":3,"file":"usePrefetchQuery.d.ts","names":[],"sources":["../../src/usePrefetchQuery.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsCgB,iBACd,wBACA,SAAS,cACT,QAAQ,cACR,aAAa,cACb,kBAAkB,WAAW,UAE7B,SAAS,wBACP,cACA,QACA,OACA,YACA,YAEF,cAAc"}
@@ -1,6 +1,6 @@
1
1
  import { useQueryClient } from "./QueryClientProvider.js";
2
2
  import { noop } from "@tanstack/query-core";
3
- //#region src/usePrefetchQuery.tsx
3
+ // src/usePrefetchQuery.tsx
4
4
  /**
5
5
  * `usePrefetchQuery` does not return anything, it should be used just to fire a prefetch during render, before
6
6
  * a suspense boundary that wraps a component that uses `useSuspenseQuery`. You can pass everything to
@@ -37,7 +37,6 @@ function usePrefetchQuery(options, queryClient) {
37
37
  const client = useQueryClient(queryClient);
38
38
  if (!client.getQueryState(options.queryKey)) client.query(options).catch(noop);
39
39
  }
40
- //#endregion
41
40
  export { usePrefetchQuery };
42
41
 
43
42
  //# sourceMappingURL=usePrefetchQuery.js.map
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
3
+ const require_rolldown_runtime = require("./rolldown-runtime-CmQyd0Gu.cjs");
4
4
  const require_QueryClientProvider = require("./QueryClientProvider.cjs");
5
5
  const require_IsRestoringProvider = require("./IsRestoringProvider.cjs");
6
6
  const require_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs");
@@ -9,7 +9,7 @@ const require_suspense = require("./suspense.cjs");
9
9
  let react = require("react");
10
10
  react = require_rolldown_runtime.__toESM(react, 1);
11
11
  let _tanstack_query_core = require("@tanstack/query-core");
12
- //#region src/useQueries.ts
12
+ // src/useQueries.ts
13
13
  /**
14
14
  * The `useQueries` hook can be used to fetch a variable number of queries.
15
15
  *
@@ -193,7 +193,6 @@ function useQueries({ queries, ...options }, queryClient) {
193
193
  if (firstSingleResultWhichShouldThrow) throw firstSingleResultWhichShouldThrow.error;
194
194
  return getCombinedResult(trackResult());
195
195
  }
196
- //#endregion
197
196
  exports.useQueries = useQueries;
198
197
 
199
198
  //# sourceMappingURL=useQueries.cjs.map
@@ -1,6 +1,5 @@
1
1
  import { DefinedUseQueryResult, UseQueryOptions, UseQueryResult } from "./types.cjs";
2
2
  import { DefaultError, OmitKeyof, QueriesPlaceholderDataFunction, QueryClient, QueryFunction, QueryKey, ThrowOnError } from "@tanstack/query-core";
3
- //#region src/useQueries.d.ts
4
3
  type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'placeholderData' | 'subscribed'> & {
5
4
  placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction<TQueryFnData>;
6
5
  };
@@ -215,5 +214,4 @@ export declare function useQueries<T extends Array<any>, TCombinedResult = Queri
215
214
  */
216
215
  subscribed?: boolean;
217
216
  }, queryClient?: QueryClient): TCombinedResult;
218
- //#endregion
219
217
  //# sourceMappingURL=useQueries.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useQueries.d.cts","names":[],"sources":["../../src/useQueries.ts"],"mappings":";;;KAyCK,6BACH,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,YAC3B,UACF,gBAAgB,cAAc,QAAQ,OAAO;EAG7C,kBAAkB,eAAe,+BAA+B;;KAI7D;KAGA;KAEA,gCAAgC,KAEnC;EACE,mBAAmB;EACnB,cAAc;EACd,YAAY;IAEV,6BAA6B,cAAc,QAAQ,SACnD;EAAY,mBAAmB;EAAc,cAAc;IACzD,6BAA6B,cAAc,UAC3C;EAAY,YAAY;EAAO,cAAc;IAC3C,sCAAsC,QAAQ,SAE9C,iBAAiB,oBAAoB,cAAc,SACjD,6BAA6B,cAAc,QAAQ,SACnD,iBAAiB,oBAAoB,UACnC,6BAA6B,cAAc,UAC3C,iBAAiB,gBACf,6BAA6B,gBAE7B;EACI,UACI,oBAAoB,oBAAoB,aACxC;EACJ,UAAU,oBAAoB;EAC9B,eAAe,wBAAwB;IAEzC,6BACE,8BACgB,SAAS,eAAe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/B,YACG;;;;;;;EAQH,sBACiB,eAAe,sBACZ,WAAW,IAAI,gCAAgC,EAAE;;;;;EAKrE,WAAW,QAAQ,eAAe,OAAO;;;;;EAKzC;GAEF,cAAc,cACb"}
@@ -1,6 +1,5 @@
1
1
  import { DefinedUseQueryResult, UseQueryOptions, UseQueryResult } from "./types.js";
2
2
  import { DefaultError, OmitKeyof, QueriesPlaceholderDataFunction, QueryClient, QueryFunction, QueryKey, ThrowOnError } from "@tanstack/query-core";
3
- //#region src/useQueries.d.ts
4
3
  type UseQueryOptionsForUseQueries<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'placeholderData' | 'subscribed'> & {
5
4
  placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction<TQueryFnData>;
6
5
  };
@@ -215,5 +214,4 @@ export declare function useQueries<T extends Array<any>, TCombinedResult = Queri
215
214
  */
216
215
  subscribed?: boolean;
217
216
  }, queryClient?: QueryClient): TCombinedResult;
218
- //#endregion
219
217
  //# sourceMappingURL=useQueries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useQueries.d.ts","names":[],"sources":["../../src/useQueries.ts"],"mappings":";;;KAyCK,6BACH,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,YAC3B,UACF,gBAAgB,cAAc,QAAQ,OAAO;EAG7C,kBAAkB,eAAe,+BAA+B;;KAI7D;KAGA;KAEA,gCAAgC,KAEnC;EACE,mBAAmB;EACnB,cAAc;EACd,YAAY;IAEV,6BAA6B,cAAc,QAAQ,SACnD;EAAY,mBAAmB;EAAc,cAAc;IACzD,6BAA6B,cAAc,UAC3C;EAAY,YAAY;EAAO,cAAc;IAC3C,sCAAsC,QAAQ,SAE9C,iBAAiB,oBAAoB,cAAc,SACjD,6BAA6B,cAAc,QAAQ,SACnD,iBAAiB,oBAAoB,UACnC,6BAA6B,cAAc,UAC3C,iB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAmIhC,WACd,UAAU,YACV,kBAAkB,eAAe,MAG/B,YACG;;;;;;;EAQH,sBACiB,eAAe,sBACZ,WAAW,IAAI,gCAAgC,EAAE;;;;;EAKrE,WAAW,QAAQ,eAAe,OAAO;;;;;EAKzC;GAEF,cAAc,cACb"}
@@ -6,7 +6,7 @@ import { ensurePreventErrorBoundaryRetry, getHasError, useClearResetErrorBoundar
6
6
  import { ensureSuspenseTimers, fetchOptimistic, shouldSuspend } from "./suspense.js";
7
7
  import * as React from "react";
8
8
  import { QueriesObserver, QueryObserver, noop, notifyManager } from "@tanstack/query-core";
9
- //#region src/useQueries.ts
9
+ // src/useQueries.ts
10
10
  /**
11
11
  * The `useQueries` hook can be used to fetch a variable number of queries.
12
12
  *
@@ -190,7 +190,6 @@ function useQueries({ queries, ...options }, queryClient) {
190
190
  if (firstSingleResultWhichShouldThrow) throw firstSingleResultWhichShouldThrow.error;
191
191
  return getCombinedResult(trackResult());
192
192
  }
193
- //#endregion
194
193
  export { useQueries };
195
194
 
196
195
  //# sourceMappingURL=useQueries.js.map
@@ -2,11 +2,10 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require_useBaseQuery = require("./useBaseQuery.cjs");
4
4
  let _tanstack_query_core = require("@tanstack/query-core");
5
- //#region src/useQuery.ts
5
+ // src/useQuery.ts
6
6
  function useQuery(options, queryClient) {
7
7
  return require_useBaseQuery.useBaseQuery(options, _tanstack_query_core.QueryObserver, queryClient);
8
8
  }
9
- //#endregion
10
9
  exports.useQuery = useQuery;
11
10
 
12
11
  //# sourceMappingURL=useQuery.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useQuery.cjs","names":["useBaseQuery","QueryObserver"],"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\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/react-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/react-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/react-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/react-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/react-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/react-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/react-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/react-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/react-query'\n * import { useState } from 'react'\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,OAAOA,qBAAAA,aAAa,SAASC,qBAAAA,eAAe,WAAW;AACzD"}
1
+ {"version":3,"file":"useQuery.cjs","names":["useBaseQuery","QueryObserver"],"sources":["../../src/useQuery.ts"],"sourcesContent":["'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\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/react-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/react-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/react-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/react-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/react-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/react-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/react-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/react-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/react-query'\n * import { useState } from 'react'\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,OAAOA,qBAAAA,aAAa,SAASC,qBAAAA,eAAe,WAAW;AACzD"}
@@ -1,11 +1,10 @@
1
1
  import { DefinedUseQueryResult, UseQueryOptions, UseQueryResult } from "./types.cjs";
2
2
  import { DefinedInitialDataOptions, UndefinedInitialDataOptions } from "./queryOptions.cjs";
3
3
  import { DefaultError, QueryClient, QueryKey } from "@tanstack/query-core";
4
- //#region src/useQuery.d.ts
5
4
  /**
6
- * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless
7
- * a `select` changes `TData` to include `undefined`).
8
- * @param options - The {@link DefinedInitialDataOptions} to use — everything you can pass to `useQuery`, with `initialData` set.
5
+ * This overload is selected when `initialData` is known to be defined, so the resulting `data` is never
6
+ * `undefined` (unless a `select` changes `TData` to include `undefined`).
7
+ * @param options - The {@link DefinedInitialDataOptions} to use — everything you can pass to `useQuery`, with `initialData` known to be defined.
9
8
  * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will
10
9
  * be used.
11
10
  * @returns The current query result, typed so that `status` is `success` — or `error` if a fetch attempt
@@ -38,8 +37,8 @@ import { DefaultError, QueryClient, QueryKey } from "@tanstack/query-core";
38
37
  */
39
38
  export declare function useQuery<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError>;
40
39
  /**
41
- * This overload is selected when `initialData` is omitted or may be `undefined`, so the resulting `data`
42
- * can be `undefined`.
40
+ * This overload is selected when `initialData` is omitted, may be `undefined`, or is a function that may
41
+ * return `undefined`, so the resulting `data` can be `undefined`.
43
42
  * @param options - The {@link UndefinedInitialDataOptions} to use — everything you can pass to `useQuery`.
44
43
  * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will
45
44
  * be used.
@@ -251,5 +250,4 @@ export declare function useQuery<TQueryFnData = unknown, TError = DefaultError,
251
250
  * ```
252
251
  */
253
252
  export declare function useQuery<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: QueryClient): UseQueryResult<TData, TError>;
254
- //#endregion
255
253
  //# sourceMappingURL=useQuery.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useQuery.d.cts","names":[],"sources":["../../src/useQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgDgB,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,0BAA0B,cAAc,QAAQ,OAAO,YAChE,cAAc,cACb,sBAAsB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2DhB,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,4BAA4B,cAAc,QAAQ,OAAO,YAClE,cAAc,cACb,eAAe,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6JT,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,gBAAgB,cAAc,QAAQ,OAAO,YACtD,cAAc,cACb,eAAe,OAAO"}
1
+ {"version":3,"file":"useQuery.d.cts","names":[],"sources":["../../src/useQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgDgB,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,0BAA0B,cAAc,QAAQ,OAAO,YAChE,cAAc,cACb,sBAAsB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2DhB,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,4BAA4B,cAAc,QAAQ,OAAO,YAClE,cAAc,cACb,eAAe,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6JT,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,gBAAgB,cAAc,QAAQ,OAAO,YACtD,cAAc,cACb,eAAe,OAAO"}
@@ -1,11 +1,10 @@
1
1
  import { DefinedUseQueryResult, UseQueryOptions, UseQueryResult } from "./types.js";
2
2
  import { DefinedInitialDataOptions, UndefinedInitialDataOptions } from "./queryOptions.js";
3
3
  import { DefaultError, QueryClient, QueryKey } from "@tanstack/query-core";
4
- //#region src/useQuery.d.ts
5
4
  /**
6
- * This overload is selected when `initialData` is set, so the resulting `data` is never `undefined` (unless
7
- * a `select` changes `TData` to include `undefined`).
8
- * @param options - The {@link DefinedInitialDataOptions} to use — everything you can pass to `useQuery`, with `initialData` set.
5
+ * This overload is selected when `initialData` is known to be defined, so the resulting `data` is never
6
+ * `undefined` (unless a `select` changes `TData` to include `undefined`).
7
+ * @param options - The {@link DefinedInitialDataOptions} to use — everything you can pass to `useQuery`, with `initialData` known to be defined.
9
8
  * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will
10
9
  * be used.
11
10
  * @returns The current query result, typed so that `status` is `success` — or `error` if a fetch attempt
@@ -38,8 +37,8 @@ import { DefaultError, QueryClient, QueryKey } from "@tanstack/query-core";
38
37
  */
39
38
  export declare function useQuery<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError>;
40
39
  /**
41
- * This overload is selected when `initialData` is omitted or may be `undefined`, so the resulting `data`
42
- * can be `undefined`.
40
+ * This overload is selected when `initialData` is omitted, may be `undefined`, or is a function that may
41
+ * return `undefined`, so the resulting `data` can be `undefined`.
43
42
  * @param options - The {@link UndefinedInitialDataOptions} to use — everything you can pass to `useQuery`.
44
43
  * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will
45
44
  * be used.
@@ -251,5 +250,4 @@ export declare function useQuery<TQueryFnData = unknown, TError = DefaultError,
251
250
  * ```
252
251
  */
253
252
  export declare function useQuery<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, queryClient?: QueryClient): UseQueryResult<TData, TError>;
254
- //#endregion
255
253
  //# sourceMappingURL=useQuery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useQuery.d.ts","names":[],"sources":["../../src/useQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgDgB,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,0BAA0B,cAAc,QAAQ,OAAO,YAChE,cAAc,cACb,sBAAsB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2DhB,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,4BAA4B,cAAc,QAAQ,OAAO,YAClE,cAAc,cACb,eAAe,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6JT,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,gBAAgB,cAAc,QAAQ,OAAO,YACtD,cAAc,cACb,eAAe,OAAO"}
1
+ {"version":3,"file":"useQuery.d.ts","names":[],"sources":["../../src/useQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAgDgB,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,0BAA0B,cAAc,QAAQ,OAAO,YAChE,cAAc,cACb,sBAAsB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2DhB,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,4BAA4B,cAAc,QAAQ,OAAO,YAClE,cAAc,cACb,eAAe,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6JT,SACd,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAE7B,SAAS,gBAAgB,cAAc,QAAQ,OAAO,YACtD,cAAc,cACb,eAAe,OAAO"}
@@ -1,11 +1,10 @@
1
1
  "use client";
2
2
  import { useBaseQuery } from "./useBaseQuery.js";
3
3
  import { QueryObserver } from "@tanstack/query-core";
4
- //#region src/useQuery.ts
4
+ // src/useQuery.ts
5
5
  function useQuery(options, queryClient) {
6
6
  return useBaseQuery(options, QueryObserver, queryClient);
7
7
  }
8
- //#endregion
9
8
  export { useQuery };
10
9
 
11
10
  //# sourceMappingURL=useQuery.js.map