@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.
- package/build/legacy/HydrationBoundary.cjs +2 -3
- package/build/legacy/HydrationBoundary.cjs.map +1 -1
- package/build/legacy/HydrationBoundary.d.cts +0 -2
- package/build/legacy/HydrationBoundary.d.cts.map +1 -1
- package/build/legacy/HydrationBoundary.d.ts +0 -2
- package/build/legacy/HydrationBoundary.d.ts.map +1 -1
- package/build/legacy/HydrationBoundary.js +1 -2
- package/build/legacy/HydrationBoundary.js.map +1 -1
- package/build/legacy/IsRestoringProvider.cjs +2 -3
- package/build/legacy/IsRestoringProvider.d.cts +0 -2
- package/build/legacy/IsRestoringProvider.d.cts.map +1 -1
- package/build/legacy/IsRestoringProvider.d.ts +0 -2
- package/build/legacy/IsRestoringProvider.d.ts.map +1 -1
- package/build/legacy/IsRestoringProvider.js +1 -2
- package/build/legacy/QueryClientProvider.cjs +2 -3
- package/build/legacy/QueryClientProvider.d.cts +0 -2
- package/build/legacy/QueryClientProvider.d.cts.map +1 -1
- package/build/legacy/QueryClientProvider.d.ts +0 -2
- package/build/legacy/QueryClientProvider.d.ts.map +1 -1
- package/build/legacy/QueryClientProvider.js +1 -2
- package/build/legacy/QueryErrorResetBoundary.cjs +2 -3
- package/build/legacy/QueryErrorResetBoundary.d.cts +1 -3
- package/build/legacy/QueryErrorResetBoundary.d.cts.map +1 -1
- package/build/legacy/QueryErrorResetBoundary.d.ts +1 -3
- package/build/legacy/QueryErrorResetBoundary.d.ts.map +1 -1
- package/build/legacy/QueryErrorResetBoundary.js +1 -2
- package/build/legacy/errorBoundaryUtils.cjs +2 -3
- package/build/legacy/errorBoundaryUtils.d.cts +0 -2
- package/build/legacy/errorBoundaryUtils.d.cts.map +1 -1
- package/build/legacy/errorBoundaryUtils.d.ts +0 -2
- package/build/legacy/errorBoundaryUtils.d.ts.map +1 -1
- package/build/legacy/errorBoundaryUtils.js +1 -2
- package/build/legacy/index.cjs +1 -2
- package/build/legacy/index.js +1 -2
- package/build/legacy/infiniteQueryOptions.cjs +1 -2
- package/build/legacy/infiniteQueryOptions.cjs.map +1 -1
- package/build/legacy/infiniteQueryOptions.d.cts +16 -16
- package/build/legacy/infiniteQueryOptions.d.cts.map +1 -1
- package/build/legacy/infiniteQueryOptions.d.ts +16 -16
- package/build/legacy/infiniteQueryOptions.d.ts.map +1 -1
- package/build/legacy/infiniteQueryOptions.js +1 -2
- package/build/legacy/infiniteQueryOptions.js.map +1 -1
- package/build/legacy/mutationOptions.cjs +1 -2
- package/build/legacy/mutationOptions.d.cts +0 -2
- package/build/legacy/mutationOptions.d.cts.map +1 -1
- package/build/legacy/mutationOptions.d.ts +0 -2
- package/build/legacy/mutationOptions.d.ts.map +1 -1
- package/build/legacy/mutationOptions.js +1 -2
- package/build/legacy/queryOptions.cjs +1 -2
- package/build/legacy/queryOptions.cjs.map +1 -1
- package/build/legacy/queryOptions.d.cts +16 -15
- package/build/legacy/queryOptions.d.cts.map +1 -1
- package/build/legacy/queryOptions.d.ts +16 -15
- package/build/legacy/queryOptions.d.ts.map +1 -1
- package/build/legacy/queryOptions.js +1 -2
- package/build/legacy/queryOptions.js.map +1 -1
- package/build/legacy/{rolldown-runtime-VH7oDXx4.cjs → rolldown-runtime-CmQyd0Gu.cjs} +1 -2
- package/build/legacy/suspense.cjs +1 -2
- package/build/legacy/suspense.d.cts +0 -2
- package/build/legacy/suspense.d.cts.map +1 -1
- package/build/legacy/suspense.d.ts +0 -2
- package/build/legacy/suspense.d.ts.map +1 -1
- package/build/legacy/suspense.js +1 -2
- package/build/legacy/types.cjs +1 -2
- package/build/legacy/types.d.cts +0 -2
- package/build/legacy/types.d.cts.map +1 -1
- package/build/legacy/types.d.ts +0 -2
- package/build/legacy/types.d.ts.map +1 -1
- package/build/legacy/types.js +1 -2
- package/build/legacy/useBaseQuery.cjs +2 -3
- package/build/legacy/useBaseQuery.d.cts +0 -2
- package/build/legacy/useBaseQuery.d.cts.map +1 -1
- package/build/legacy/useBaseQuery.d.ts +0 -2
- package/build/legacy/useBaseQuery.d.ts.map +1 -1
- package/build/legacy/useBaseQuery.js +1 -2
- package/build/legacy/useInfiniteQuery.cjs +1 -2
- package/build/legacy/useInfiniteQuery.cjs.map +1 -1
- package/build/legacy/useInfiniteQuery.d.cts +2 -4
- package/build/legacy/useInfiniteQuery.d.cts.map +1 -1
- package/build/legacy/useInfiniteQuery.d.ts +2 -4
- package/build/legacy/useInfiniteQuery.d.ts.map +1 -1
- package/build/legacy/useInfiniteQuery.js +1 -2
- package/build/legacy/useInfiniteQuery.js.map +1 -1
- package/build/legacy/useIsFetching.cjs +2 -3
- package/build/legacy/useIsFetching.cjs.map +1 -1
- package/build/legacy/useIsFetching.d.cts +1 -3
- package/build/legacy/useIsFetching.d.cts.map +1 -1
- package/build/legacy/useIsFetching.d.ts +1 -3
- package/build/legacy/useIsFetching.d.ts.map +1 -1
- package/build/legacy/useIsFetching.js +1 -2
- package/build/legacy/useIsFetching.js.map +1 -1
- package/build/legacy/useMutation.cjs +2 -3
- package/build/legacy/useMutation.d.cts +0 -2
- package/build/legacy/useMutation.d.cts.map +1 -1
- package/build/legacy/useMutation.d.ts +0 -2
- package/build/legacy/useMutation.d.ts.map +1 -1
- package/build/legacy/useMutation.js +1 -2
- package/build/legacy/useMutationState.cjs +2 -3
- package/build/legacy/useMutationState.d.cts +0 -2
- package/build/legacy/useMutationState.d.cts.map +1 -1
- package/build/legacy/useMutationState.d.ts +0 -2
- package/build/legacy/useMutationState.d.ts.map +1 -1
- package/build/legacy/useMutationState.js +1 -2
- package/build/legacy/usePrefetchInfiniteQuery.cjs +1 -2
- package/build/legacy/usePrefetchInfiniteQuery.d.cts +0 -2
- package/build/legacy/usePrefetchInfiniteQuery.d.cts.map +1 -1
- package/build/legacy/usePrefetchInfiniteQuery.d.ts +0 -2
- package/build/legacy/usePrefetchInfiniteQuery.d.ts.map +1 -1
- package/build/legacy/usePrefetchInfiniteQuery.js +1 -2
- package/build/legacy/usePrefetchQuery.cjs +1 -2
- package/build/legacy/usePrefetchQuery.d.cts +0 -2
- package/build/legacy/usePrefetchQuery.d.cts.map +1 -1
- package/build/legacy/usePrefetchQuery.d.ts +0 -2
- package/build/legacy/usePrefetchQuery.d.ts.map +1 -1
- package/build/legacy/usePrefetchQuery.js +1 -2
- package/build/legacy/useQueries.cjs +2 -3
- package/build/legacy/useQueries.d.cts +0 -2
- package/build/legacy/useQueries.d.cts.map +1 -1
- package/build/legacy/useQueries.d.ts +0 -2
- package/build/legacy/useQueries.d.ts.map +1 -1
- package/build/legacy/useQueries.js +1 -2
- package/build/legacy/useQuery.cjs +1 -2
- package/build/legacy/useQuery.cjs.map +1 -1
- package/build/legacy/useQuery.d.cts +5 -7
- package/build/legacy/useQuery.d.cts.map +1 -1
- package/build/legacy/useQuery.d.ts +5 -7
- package/build/legacy/useQuery.d.ts.map +1 -1
- package/build/legacy/useQuery.js +1 -2
- package/build/legacy/useQuery.js.map +1 -1
- package/build/legacy/useSuspenseInfiniteQuery.cjs +1 -2
- package/build/legacy/useSuspenseInfiniteQuery.d.cts +0 -2
- package/build/legacy/useSuspenseInfiniteQuery.d.cts.map +1 -1
- package/build/legacy/useSuspenseInfiniteQuery.d.ts +0 -2
- package/build/legacy/useSuspenseInfiniteQuery.d.ts.map +1 -1
- package/build/legacy/useSuspenseInfiniteQuery.js +1 -2
- package/build/legacy/useSuspenseQueries.cjs +1 -2
- package/build/legacy/useSuspenseQueries.d.cts +0 -2
- package/build/legacy/useSuspenseQueries.d.cts.map +1 -1
- package/build/legacy/useSuspenseQueries.d.ts +0 -2
- package/build/legacy/useSuspenseQueries.d.ts.map +1 -1
- package/build/legacy/useSuspenseQueries.js +1 -2
- package/build/legacy/useSuspenseQuery.cjs +1 -2
- package/build/legacy/useSuspenseQuery.d.cts +0 -2
- package/build/legacy/useSuspenseQuery.d.cts.map +1 -1
- package/build/legacy/useSuspenseQuery.d.ts +0 -2
- package/build/legacy/useSuspenseQuery.d.ts.map +1 -1
- package/build/legacy/useSuspenseQuery.js +1 -2
- package/build/modern/HydrationBoundary.cjs +2 -3
- package/build/modern/HydrationBoundary.cjs.map +1 -1
- package/build/modern/HydrationBoundary.d.cts +0 -2
- package/build/modern/HydrationBoundary.d.cts.map +1 -1
- package/build/modern/HydrationBoundary.d.ts +0 -2
- package/build/modern/HydrationBoundary.d.ts.map +1 -1
- package/build/modern/HydrationBoundary.js +1 -2
- package/build/modern/HydrationBoundary.js.map +1 -1
- package/build/modern/IsRestoringProvider.cjs +2 -3
- package/build/modern/IsRestoringProvider.d.cts +0 -2
- package/build/modern/IsRestoringProvider.d.cts.map +1 -1
- package/build/modern/IsRestoringProvider.d.ts +0 -2
- package/build/modern/IsRestoringProvider.d.ts.map +1 -1
- package/build/modern/IsRestoringProvider.js +1 -2
- package/build/modern/QueryClientProvider.cjs +2 -3
- package/build/modern/QueryClientProvider.d.cts +0 -2
- package/build/modern/QueryClientProvider.d.cts.map +1 -1
- package/build/modern/QueryClientProvider.d.ts +0 -2
- package/build/modern/QueryClientProvider.d.ts.map +1 -1
- package/build/modern/QueryClientProvider.js +1 -2
- package/build/modern/QueryErrorResetBoundary.cjs +2 -3
- package/build/modern/QueryErrorResetBoundary.d.cts +1 -3
- package/build/modern/QueryErrorResetBoundary.d.cts.map +1 -1
- package/build/modern/QueryErrorResetBoundary.d.ts +1 -3
- package/build/modern/QueryErrorResetBoundary.d.ts.map +1 -1
- package/build/modern/QueryErrorResetBoundary.js +1 -2
- package/build/modern/errorBoundaryUtils.cjs +2 -3
- package/build/modern/errorBoundaryUtils.d.cts +0 -2
- package/build/modern/errorBoundaryUtils.d.cts.map +1 -1
- package/build/modern/errorBoundaryUtils.d.ts +0 -2
- package/build/modern/errorBoundaryUtils.d.ts.map +1 -1
- package/build/modern/errorBoundaryUtils.js +1 -2
- package/build/modern/index.cjs +1 -2
- package/build/modern/index.js +1 -2
- package/build/modern/infiniteQueryOptions.cjs +1 -2
- package/build/modern/infiniteQueryOptions.cjs.map +1 -1
- package/build/modern/infiniteQueryOptions.d.cts +16 -16
- package/build/modern/infiniteQueryOptions.d.cts.map +1 -1
- package/build/modern/infiniteQueryOptions.d.ts +16 -16
- package/build/modern/infiniteQueryOptions.d.ts.map +1 -1
- package/build/modern/infiniteQueryOptions.js +1 -2
- package/build/modern/infiniteQueryOptions.js.map +1 -1
- package/build/modern/mutationOptions.cjs +1 -2
- package/build/modern/mutationOptions.d.cts +0 -2
- package/build/modern/mutationOptions.d.cts.map +1 -1
- package/build/modern/mutationOptions.d.ts +0 -2
- package/build/modern/mutationOptions.d.ts.map +1 -1
- package/build/modern/mutationOptions.js +1 -2
- package/build/modern/queryOptions.cjs +1 -2
- package/build/modern/queryOptions.cjs.map +1 -1
- package/build/modern/queryOptions.d.cts +16 -15
- package/build/modern/queryOptions.d.cts.map +1 -1
- package/build/modern/queryOptions.d.ts +16 -15
- package/build/modern/queryOptions.d.ts.map +1 -1
- package/build/modern/queryOptions.js +1 -2
- package/build/modern/queryOptions.js.map +1 -1
- package/build/modern/{rolldown-runtime-VH7oDXx4.cjs → rolldown-runtime-CmQyd0Gu.cjs} +1 -2
- package/build/modern/suspense.cjs +1 -2
- package/build/modern/suspense.d.cts +0 -2
- package/build/modern/suspense.d.cts.map +1 -1
- package/build/modern/suspense.d.ts +0 -2
- package/build/modern/suspense.d.ts.map +1 -1
- package/build/modern/suspense.js +1 -2
- package/build/modern/types.cjs +1 -2
- package/build/modern/types.d.cts +0 -2
- package/build/modern/types.d.cts.map +1 -1
- package/build/modern/types.d.ts +0 -2
- package/build/modern/types.d.ts.map +1 -1
- package/build/modern/types.js +1 -2
- package/build/modern/useBaseQuery.cjs +2 -3
- package/build/modern/useBaseQuery.d.cts +0 -2
- package/build/modern/useBaseQuery.d.cts.map +1 -1
- package/build/modern/useBaseQuery.d.ts +0 -2
- package/build/modern/useBaseQuery.d.ts.map +1 -1
- package/build/modern/useBaseQuery.js +1 -2
- package/build/modern/useInfiniteQuery.cjs +1 -2
- package/build/modern/useInfiniteQuery.cjs.map +1 -1
- package/build/modern/useInfiniteQuery.d.cts +2 -4
- package/build/modern/useInfiniteQuery.d.cts.map +1 -1
- package/build/modern/useInfiniteQuery.d.ts +2 -4
- package/build/modern/useInfiniteQuery.d.ts.map +1 -1
- package/build/modern/useInfiniteQuery.js +1 -2
- package/build/modern/useInfiniteQuery.js.map +1 -1
- package/build/modern/useIsFetching.cjs +2 -3
- package/build/modern/useIsFetching.cjs.map +1 -1
- package/build/modern/useIsFetching.d.cts +1 -3
- package/build/modern/useIsFetching.d.cts.map +1 -1
- package/build/modern/useIsFetching.d.ts +1 -3
- package/build/modern/useIsFetching.d.ts.map +1 -1
- package/build/modern/useIsFetching.js +1 -2
- package/build/modern/useIsFetching.js.map +1 -1
- package/build/modern/useMutation.cjs +2 -3
- package/build/modern/useMutation.d.cts +0 -2
- package/build/modern/useMutation.d.cts.map +1 -1
- package/build/modern/useMutation.d.ts +0 -2
- package/build/modern/useMutation.d.ts.map +1 -1
- package/build/modern/useMutation.js +1 -2
- package/build/modern/useMutationState.cjs +2 -3
- package/build/modern/useMutationState.d.cts +0 -2
- package/build/modern/useMutationState.d.cts.map +1 -1
- package/build/modern/useMutationState.d.ts +0 -2
- package/build/modern/useMutationState.d.ts.map +1 -1
- package/build/modern/useMutationState.js +1 -2
- package/build/modern/usePrefetchInfiniteQuery.cjs +1 -2
- package/build/modern/usePrefetchInfiniteQuery.d.cts +0 -2
- package/build/modern/usePrefetchInfiniteQuery.d.cts.map +1 -1
- package/build/modern/usePrefetchInfiniteQuery.d.ts +0 -2
- package/build/modern/usePrefetchInfiniteQuery.d.ts.map +1 -1
- package/build/modern/usePrefetchInfiniteQuery.js +1 -2
- package/build/modern/usePrefetchQuery.cjs +1 -2
- package/build/modern/usePrefetchQuery.d.cts +0 -2
- package/build/modern/usePrefetchQuery.d.cts.map +1 -1
- package/build/modern/usePrefetchQuery.d.ts +0 -2
- package/build/modern/usePrefetchQuery.d.ts.map +1 -1
- package/build/modern/usePrefetchQuery.js +1 -2
- package/build/modern/useQueries.cjs +2 -3
- package/build/modern/useQueries.d.cts +0 -2
- package/build/modern/useQueries.d.cts.map +1 -1
- package/build/modern/useQueries.d.ts +0 -2
- package/build/modern/useQueries.d.ts.map +1 -1
- package/build/modern/useQueries.js +1 -2
- package/build/modern/useQuery.cjs +1 -2
- package/build/modern/useQuery.cjs.map +1 -1
- package/build/modern/useQuery.d.cts +5 -7
- package/build/modern/useQuery.d.cts.map +1 -1
- package/build/modern/useQuery.d.ts +5 -7
- package/build/modern/useQuery.d.ts.map +1 -1
- package/build/modern/useQuery.js +1 -2
- package/build/modern/useQuery.js.map +1 -1
- package/build/modern/useSuspenseInfiniteQuery.cjs +1 -2
- package/build/modern/useSuspenseInfiniteQuery.d.cts +0 -2
- package/build/modern/useSuspenseInfiniteQuery.d.cts.map +1 -1
- package/build/modern/useSuspenseInfiniteQuery.d.ts +0 -2
- package/build/modern/useSuspenseInfiniteQuery.d.ts.map +1 -1
- package/build/modern/useSuspenseInfiniteQuery.js +1 -2
- package/build/modern/useSuspenseQueries.cjs +1 -2
- package/build/modern/useSuspenseQueries.d.cts +0 -2
- package/build/modern/useSuspenseQueries.d.cts.map +1 -1
- package/build/modern/useSuspenseQueries.d.ts +0 -2
- package/build/modern/useSuspenseQueries.d.ts.map +1 -1
- package/build/modern/useSuspenseQueries.js +1 -2
- package/build/modern/useSuspenseQuery.cjs +1 -2
- package/build/modern/useSuspenseQuery.d.cts +0 -2
- package/build/modern/useSuspenseQuery.d.cts.map +1 -1
- package/build/modern/useSuspenseQuery.d.ts +0 -2
- package/build/modern/useSuspenseQuery.d.ts.map +1 -1
- package/build/modern/useSuspenseQuery.js +1 -2
- package/package.json +8 -8
- package/src/HydrationBoundary.tsx +1 -1
- package/src/infiniteQueryOptions.ts +15 -14
- package/src/queryOptions.ts +16 -13
- package/src/useInfiniteQuery.ts +2 -2
- package/src/useIsFetching.ts +1 -1
- package/src/useQuery.ts +5 -5
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { DefinedUseInfiniteQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult } from "./types.cjs";
|
|
2
2
|
import { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions.cjs";
|
|
3
3
|
import { DefaultError, InfiniteData, QueryClient, QueryKey } from "@tanstack/query-core";
|
|
4
|
-
//#region src/useInfiniteQuery.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
|
|
7
6
|
* `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
|
|
8
7
|
*
|
|
9
|
-
* This overload is selected when `initialData` is
|
|
10
|
-
* @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to `useInfiniteQuery`, with `initialData`
|
|
8
|
+
* This overload is selected when `initialData` is known to be defined.
|
|
9
|
+
* @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to `useInfiniteQuery`, with `initialData` known to be defined.
|
|
11
10
|
* @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will
|
|
12
11
|
* be used.
|
|
13
12
|
* @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,
|
|
@@ -288,5 +287,4 @@ export declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TD
|
|
|
288
287
|
* ```
|
|
289
288
|
*/
|
|
290
289
|
export declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, queryClient?: QueryClient): UseInfiniteQueryResult<TData, TError>;
|
|
291
|
-
//#endregion
|
|
292
290
|
//# sourceMappingURL=useInfiniteQuery.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInfiniteQuery.d.cts","names":[],"sources":["../../src/useInfiniteQuery.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useInfiniteQuery.d.cts","names":[],"sources":["../../src/useInfiniteQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8DgB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,kCACP,cACA,QACA,OACA,WACA,aAEF,cAAc,cACb,8BAA8B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4GxB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,oCACP,cACA,QACA,OACA,WACA,aAEF,cAAc,cACb,uBAAuB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAyIjB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,wBACP,cACA,QACA,OACA,WACA,aAEF,cAAc,cACb,uBAAuB,OAAO"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { DefinedUseInfiniteQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult } from "./types.js";
|
|
2
2
|
import { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions.js";
|
|
3
3
|
import { DefaultError, InfiniteData, QueryClient, QueryKey } from "@tanstack/query-core";
|
|
4
|
-
//#region src/useInfiniteQuery.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
|
|
7
6
|
* `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
|
|
8
7
|
*
|
|
9
|
-
* This overload is selected when `initialData` is
|
|
10
|
-
* @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to `useInfiniteQuery`, with `initialData`
|
|
8
|
+
* This overload is selected when `initialData` is known to be defined.
|
|
9
|
+
* @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to `useInfiniteQuery`, with `initialData` known to be defined.
|
|
11
10
|
* @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will
|
|
12
11
|
* be used.
|
|
13
12
|
* @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,
|
|
@@ -288,5 +287,4 @@ export declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TD
|
|
|
288
287
|
* ```
|
|
289
288
|
*/
|
|
290
289
|
export declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>, queryClient?: QueryClient): UseInfiniteQueryResult<TData, TError>;
|
|
291
|
-
//#endregion
|
|
292
290
|
//# sourceMappingURL=useInfiniteQuery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInfiniteQuery.d.ts","names":[],"sources":["../../src/useInfiniteQuery.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useInfiniteQuery.d.ts","names":[],"sources":["../../src/useInfiniteQuery.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8DgB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,kCACP,cACA,QACA,OACA,WACA,aAEF,cAAc,cACb,8BAA8B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA4GxB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,oCACP,cACA,QACA,OACA,WACA,aAEF,cAAc,cACb,uBAAuB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAyIjB,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,wBACP,cACA,QACA,OACA,WACA,aAEF,cAAc,cACb,uBAAuB,OAAO"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useBaseQuery } from "./useBaseQuery.js";
|
|
3
3
|
import { InfiniteQueryObserver } from "@tanstack/query-core";
|
|
4
|
-
|
|
4
|
+
// src/useInfiniteQuery.ts
|
|
5
5
|
function useInfiniteQuery(options, queryClient) {
|
|
6
6
|
return useBaseQuery(options, InfiniteQueryObserver, queryClient);
|
|
7
7
|
}
|
|
8
|
-
//#endregion
|
|
9
8
|
export { useInfiniteQuery };
|
|
10
9
|
|
|
11
10
|
//# sourceMappingURL=useInfiniteQuery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInfiniteQuery.js","names":[],"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n *\n * This overload is selected when `initialData` is set.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to `useInfiniteQuery`, 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 same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.pages` and\n * `data.pageParams` are also added, as long as a `select` doesn't change `TData` away from its default\n * `InfiniteData<TQueryFnData>` shape.\n * @remarks Keep in mind that imperative fetch calls, such as `fetchNextPage`, may interfere with the default\n * refetch behavior, resulting in outdated data. Make sure to call these functions only in response to user\n * actions, or add conditions like `hasNextPage && !isFetching`.\n * @see {@link infiniteQueryOptions} to share these options between `useInfiniteQuery` and imperative APIs like `queryClient.infiniteQuery`.\n * @example\n * ```tsx\n * import { useInfiniteQuery } from '@tanstack/react-query'\n *\n * function Projects() {\n * // `data` is never `undefined`, thanks to `initialData` — even if a refetch fails, so the\n * // list stays visible alongside the error.\n * const { data, isError, error } = useInfiniteQuery({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * initialData: { pages: [], pageParams: [] },\n * })\n *\n * return (\n * <div>\n * {isError ? <span>Error: {error.message}</span> : null}\n * <ul>\n * {data.pages.map((page) => page.projects.map((p) => <li key={p.id}>{p.name}</li>))}\n * </ul>\n * </div>\n * )\n * }\n * ```\n */\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult<TData, TError>\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to `useInfiniteQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n * be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.pages` and\n * `data.pageParams` are also added, as long as a `select` doesn't change `TData` away from its default\n * `InfiniteData<TQueryFnData>` shape.\n * @remarks Keep in mind that imperative fetch calls, such as `fetchNextPage`, may interfere with the default\n * refetch behavior, resulting in outdated data. Make sure to call these functions only in response to user\n * actions, or add conditions like `hasNextPage && !isFetching`.\n * @see {@link infiniteQueryOptions} to share these options between `useInfiniteQuery` and imperative APIs like `queryClient.infiniteQuery`.\n * @example\n * Fetching the next page from a \"Load More\" button click:\n * ```tsx\n * import { useInfiniteQuery } from '@tanstack/react-query'\n *\n * function Projects() {\n * const { data, isPending, isError, error, fetchNextPage, hasNextPage, isFetching, isFetchingNextPage } =\n * useInfiniteQuery({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * })\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return (\n * <>\n * <ul>\n * {data.pages.map((page) =>\n * page.projects.map((project) => <li key={project.id}>{project.name}</li>),\n * )}\n * </ul>\n * <button\n * onClick={() => fetchNextPage()}\n * disabled={!hasNextPage || isFetching}\n * >\n * {isFetchingNextPage\n * ? 'Loading more...'\n * : hasNextPage\n * ? 'Load More'\n * : 'Nothing more to load'}\n * </button>\n * </>\n * )\n * }\n * ```\n * @example\n * Fetching the next page automatically as the user scrolls, using an `IntersectionObserver` on a\n * sentinel element after the list:\n * ```tsx\n * import { useInfiniteQuery } from '@tanstack/react-query'\n * import { useEffect, useRef } from 'react'\n *\n * function Projects() {\n * const {\n * data,\n * isPending,\n * isError,\n * error,\n * fetchNextPage,\n * hasNextPage,\n * isFetching,\n * isFetchingNextPage,\n * } = useInfiniteQuery({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * })\n *\n * const sentinelRef = useRef<HTMLDivElement>(null)\n *\n * useEffect(() => {\n * const sentinel = sentinelRef.current\n * if (sentinel == null || !hasNextPage || isFetching) return\n *\n * const observer = new IntersectionObserver(([entry]) => {\n * if (entry?.isIntersecting) fetchNextPage()\n * })\n * observer.observe(sentinel)\n *\n * return () => observer.disconnect()\n * }, [hasNextPage, isFetching, fetchNextPage])\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return (\n * <>\n * <ul>\n * {data.pages.map((page) =>\n * page.projects.map((project) => <li key={project.id}>{project.name}</li>),\n * )}\n * </ul>\n * <div ref={sentinelRef}>{isFetchingNextPage ? 'Loading more...' : null}</div>\n * </>\n * )\n * }\n * ```\n */\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult<TData, TError>\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n * @param options - The {@link UseInfiniteQueryOptions} to use — everything you can pass to `useInfiniteQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n * be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.pages` and\n * `data.pageParams` are also added, as long as a `select` doesn't change `TData` away from its default\n * `InfiniteData<TQueryFnData>` shape.\n * @remarks Keep in mind that imperative fetch calls, such as `fetchNextPage`, may interfere with the default\n * refetch behavior, resulting in outdated data. Make sure to call these functions only in response to user\n * actions, or add conditions like `hasNextPage && !isFetching`.\n * @see {@link infiniteQueryOptions} to share these options between `useInfiniteQuery` and imperative APIs like `queryClient.infiniteQuery`.\n * @example\n * Fetching the next page from a \"Load More\" button click:\n * ```tsx\n * import { useInfiniteQuery } from '@tanstack/react-query'\n *\n * function Projects() {\n * const { data, isPending, isError, error, fetchNextPage, hasNextPage, isFetching, isFetchingNextPage } =\n * useInfiniteQuery({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * })\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return (\n * <>\n * <ul>\n * {data.pages.map((page) =>\n * page.projects.map((project) => <li key={project.id}>{project.name}</li>),\n * )}\n * </ul>\n * <button\n * onClick={() => fetchNextPage()}\n * disabled={!hasNextPage || isFetching}\n * >\n * {isFetchingNextPage\n * ? 'Loading more...'\n * : hasNextPage\n * ? 'Load More'\n * : 'Nothing more to load'}\n * </button>\n * </>\n * )\n * }\n * ```\n * @example\n * Fetching the next page automatically as the user scrolls, using an `IntersectionObserver` on a\n * sentinel element after the list:\n * ```tsx\n * import { useInfiniteQuery } from '@tanstack/react-query'\n * import { useEffect, useRef } from 'react'\n *\n * function Projects() {\n * const {\n * data,\n * isPending,\n * isError,\n * error,\n * fetchNextPage,\n * hasNextPage,\n * isFetching,\n * isFetchingNextPage,\n * } = useInfiniteQuery({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * })\n *\n * const sentinelRef = useRef<HTMLDivElement>(null)\n *\n * useEffect(() => {\n * const sentinel = sentinelRef.current\n * if (sentinel == null || !hasNextPage || isFetching) return\n *\n * const observer = new IntersectionObserver(([entry]) => {\n * if (entry?.isIntersecting) fetchNextPage()\n * })\n * observer.observe(sentinel)\n *\n * return () => observer.disconnect()\n * }, [hasNextPage, isFetching, fetchNextPage])\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return (\n * <>\n * <ul>\n * {data.pages.map((page) =>\n * page.projects.map((project) => <li key={project.id}>{project.name}</li>),\n * )}\n * </ul>\n * <div ref={sentinelRef}>{isFetchingNextPage ? 'Loading more...' : null}</div>\n * </>\n * )\n * }\n * ```\n * @example\n * A query that's disabled, type safe, until `postId` is set — pass `skipToken` as `queryFn`\n * instead of setting `enabled: false`:\n * ```tsx\n * import { skipToken, useInfiniteQuery } from '@tanstack/react-query'\n *\n * function Comments({ postId }: { postId: string | undefined }) {\n * // Use `isLoading`, not `isPending`, so the loading state doesn't show while the query is disabled.\n * const { data, isLoading, isError, error } = useInfiniteQuery({\n * queryKey: ['post', postId, 'comments'],\n * queryFn:\n * postId != null\n * ? ({ pageParam }) => fetchComments(postId, pageParam)\n * : skipToken,\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\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 (\n * <ul>\n * {data?.pages.map((page) => page.comments.map((c) => <li key={c.id}>{c.text}</li>))}\n * </ul>\n * )\n * }\n * ```\n */\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult<TData, TError>\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n"],"mappings":";;;;AAkWA,SAAgB,iBACd,SACA,aACA;CACA,OAAO,aACL,SACA,uBACA,WACF;AACF"}
|
|
1
|
+
{"version":3,"file":"useInfiniteQuery.js","names":[],"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n *\n * This overload is selected when `initialData` is known to be defined.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to `useInfiniteQuery`, 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 same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.pages` and\n * `data.pageParams` are also added, as long as a `select` doesn't change `TData` away from its default\n * `InfiniteData<TQueryFnData>` shape.\n * @remarks Keep in mind that imperative fetch calls, such as `fetchNextPage`, may interfere with the default\n * refetch behavior, resulting in outdated data. Make sure to call these functions only in response to user\n * actions, or add conditions like `hasNextPage && !isFetching`.\n * @see {@link infiniteQueryOptions} to share these options between `useInfiniteQuery` and imperative APIs like `queryClient.infiniteQuery`.\n * @example\n * ```tsx\n * import { useInfiniteQuery } from '@tanstack/react-query'\n *\n * function Projects() {\n * // `data` is never `undefined`, thanks to `initialData` — even if a refetch fails, so the\n * // list stays visible alongside the error.\n * const { data, isError, error } = useInfiniteQuery({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * initialData: { pages: [], pageParams: [] },\n * })\n *\n * return (\n * <div>\n * {isError ? <span>Error: {error.message}</span> : null}\n * <ul>\n * {data.pages.map((page) => page.projects.map((p) => <li key={p.id}>{p.name}</li>))}\n * </ul>\n * </div>\n * )\n * }\n * ```\n */\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult<TData, TError>\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to `useInfiniteQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n * be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.pages` and\n * `data.pageParams` are also added, as long as a `select` doesn't change `TData` away from its default\n * `InfiniteData<TQueryFnData>` shape.\n * @remarks Keep in mind that imperative fetch calls, such as `fetchNextPage`, may interfere with the default\n * refetch behavior, resulting in outdated data. Make sure to call these functions only in response to user\n * actions, or add conditions like `hasNextPage && !isFetching`.\n * @see {@link infiniteQueryOptions} to share these options between `useInfiniteQuery` and imperative APIs like `queryClient.infiniteQuery`.\n * @example\n * Fetching the next page from a \"Load More\" button click:\n * ```tsx\n * import { useInfiniteQuery } from '@tanstack/react-query'\n *\n * function Projects() {\n * const { data, isPending, isError, error, fetchNextPage, hasNextPage, isFetching, isFetchingNextPage } =\n * useInfiniteQuery({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * })\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return (\n * <>\n * <ul>\n * {data.pages.map((page) =>\n * page.projects.map((project) => <li key={project.id}>{project.name}</li>),\n * )}\n * </ul>\n * <button\n * onClick={() => fetchNextPage()}\n * disabled={!hasNextPage || isFetching}\n * >\n * {isFetchingNextPage\n * ? 'Loading more...'\n * : hasNextPage\n * ? 'Load More'\n * : 'Nothing more to load'}\n * </button>\n * </>\n * )\n * }\n * ```\n * @example\n * Fetching the next page automatically as the user scrolls, using an `IntersectionObserver` on a\n * sentinel element after the list:\n * ```tsx\n * import { useInfiniteQuery } from '@tanstack/react-query'\n * import { useEffect, useRef } from 'react'\n *\n * function Projects() {\n * const {\n * data,\n * isPending,\n * isError,\n * error,\n * fetchNextPage,\n * hasNextPage,\n * isFetching,\n * isFetchingNextPage,\n * } = useInfiniteQuery({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * })\n *\n * const sentinelRef = useRef<HTMLDivElement>(null)\n *\n * useEffect(() => {\n * const sentinel = sentinelRef.current\n * if (sentinel == null || !hasNextPage || isFetching) return\n *\n * const observer = new IntersectionObserver(([entry]) => {\n * if (entry?.isIntersecting) fetchNextPage()\n * })\n * observer.observe(sentinel)\n *\n * return () => observer.disconnect()\n * }, [hasNextPage, isFetching, fetchNextPage])\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return (\n * <>\n * <ul>\n * {data.pages.map((page) =>\n * page.projects.map((project) => <li key={project.id}>{project.name}</li>),\n * )}\n * </ul>\n * <div ref={sentinelRef}>{isFetchingNextPage ? 'Loading more...' : null}</div>\n * </>\n * )\n * }\n * ```\n */\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult<TData, TError>\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n * @param options - The {@link UseInfiniteQueryOptions} to use — everything you can pass to `useInfiniteQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one from the nearest context will\n * be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.pages` and\n * `data.pageParams` are also added, as long as a `select` doesn't change `TData` away from its default\n * `InfiniteData<TQueryFnData>` shape.\n * @remarks Keep in mind that imperative fetch calls, such as `fetchNextPage`, may interfere with the default\n * refetch behavior, resulting in outdated data. Make sure to call these functions only in response to user\n * actions, or add conditions like `hasNextPage && !isFetching`.\n * @see {@link infiniteQueryOptions} to share these options between `useInfiniteQuery` and imperative APIs like `queryClient.infiniteQuery`.\n * @example\n * Fetching the next page from a \"Load More\" button click:\n * ```tsx\n * import { useInfiniteQuery } from '@tanstack/react-query'\n *\n * function Projects() {\n * const { data, isPending, isError, error, fetchNextPage, hasNextPage, isFetching, isFetchingNextPage } =\n * useInfiniteQuery({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * })\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return (\n * <>\n * <ul>\n * {data.pages.map((page) =>\n * page.projects.map((project) => <li key={project.id}>{project.name}</li>),\n * )}\n * </ul>\n * <button\n * onClick={() => fetchNextPage()}\n * disabled={!hasNextPage || isFetching}\n * >\n * {isFetchingNextPage\n * ? 'Loading more...'\n * : hasNextPage\n * ? 'Load More'\n * : 'Nothing more to load'}\n * </button>\n * </>\n * )\n * }\n * ```\n * @example\n * Fetching the next page automatically as the user scrolls, using an `IntersectionObserver` on a\n * sentinel element after the list:\n * ```tsx\n * import { useInfiniteQuery } from '@tanstack/react-query'\n * import { useEffect, useRef } from 'react'\n *\n * function Projects() {\n * const {\n * data,\n * isPending,\n * isError,\n * error,\n * fetchNextPage,\n * hasNextPage,\n * isFetching,\n * isFetchingNextPage,\n * } = useInfiniteQuery({\n * queryKey: ['projects'],\n * queryFn: ({ pageParam }) => fetchProjects(pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * })\n *\n * const sentinelRef = useRef<HTMLDivElement>(null)\n *\n * useEffect(() => {\n * const sentinel = sentinelRef.current\n * if (sentinel == null || !hasNextPage || isFetching) return\n *\n * const observer = new IntersectionObserver(([entry]) => {\n * if (entry?.isIntersecting) fetchNextPage()\n * })\n * observer.observe(sentinel)\n *\n * return () => observer.disconnect()\n * }, [hasNextPage, isFetching, fetchNextPage])\n *\n * if (isPending) return 'Loading...'\n * if (isError) return <span>Error: {error.message}</span>\n *\n * return (\n * <>\n * <ul>\n * {data.pages.map((page) =>\n * page.projects.map((project) => <li key={project.id}>{project.name}</li>),\n * )}\n * </ul>\n * <div ref={sentinelRef}>{isFetchingNextPage ? 'Loading more...' : null}</div>\n * </>\n * )\n * }\n * ```\n * @example\n * A query that's disabled, type safe, until `postId` is set — pass `skipToken` as `queryFn`\n * instead of setting `enabled: false`:\n * ```tsx\n * import { skipToken, useInfiniteQuery } from '@tanstack/react-query'\n *\n * function Comments({ postId }: { postId: string | undefined }) {\n * // Use `isLoading`, not `isPending`, so the loading state doesn't show while the query is disabled.\n * const { data, isLoading, isError, error } = useInfiniteQuery({\n * queryKey: ['post', postId, 'comments'],\n * queryFn:\n * postId != null\n * ? ({ pageParam }) => fetchComments(postId, pageParam)\n * : skipToken,\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\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 (\n * <ul>\n * {data?.pages.map((page) => page.comments.map((c) => <li key={c.id}>{c.text}</li>))}\n * </ul>\n * )\n * }\n * ```\n */\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult<TData, TError>\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n"],"mappings":";;;;AAkWA,SAAgB,iBACd,SACA,aACA;CACA,OAAO,aACL,SACA,uBACA,WACF;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-
|
|
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
|
-
|
|
8
|
+
// src/useIsFetching.ts
|
|
9
9
|
/**
|
|
10
10
|
* The `useIsFetching` hook returns the `number` of the queries that your application is loading or fetching in
|
|
11
11
|
* the background (useful for app-wide loading indicators).
|
|
@@ -44,7 +44,6 @@ function useIsFetching(filters, queryClient) {
|
|
|
44
44
|
const queryCache = client.getQueryCache();
|
|
45
45
|
return react.useSyncExternalStore(react.useCallback((onStoreChange) => queryCache.subscribe(_tanstack_query_core.notifyManager.batchCalls(onStoreChange)), [queryCache]), () => client.isFetching(filters), () => client.isFetching(filters));
|
|
46
46
|
}
|
|
47
|
-
//#endregion
|
|
48
47
|
exports.useIsFetching = useIsFetching;
|
|
49
48
|
|
|
50
49
|
//# sourceMappingURL=useIsFetching.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsFetching.cjs","names":["useQueryClient","React","notifyManager"],"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
|
|
1
|
+
{"version":3,"file":"useIsFetching.cjs","names":["useQueryClient","React","notifyManager"],"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,SAASA,4BAAAA,eAAe,WAAW;CACzC,MAAM,aAAa,OAAO,cAAc;CAExC,OAAOC,MAAM,qBACXA,MAAM,aACH,kBACC,WAAW,UAAUC,qBAAAA,cAAc,WAAW,aAAa,CAAC,GAC9D,CAAC,UAAU,CACb,SACM,OAAO,WAAW,OAAO,SACzB,OAAO,WAAW,OAAO,CACjC;AACF"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { QueryClient, QueryFilters } from "@tanstack/query-core";
|
|
2
|
-
//#region src/useIsFetching.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The `useIsFetching` hook returns the `number` of the queries that your application is loading or fetching in
|
|
5
4
|
* the background (useful for app-wide loading indicators).
|
|
@@ -33,6 +32,5 @@ import { QueryClient, QueryFilters } from "@tanstack/query-core";
|
|
|
33
32
|
* }
|
|
34
33
|
* ```
|
|
35
34
|
*/
|
|
36
|
-
export declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number;
|
|
37
|
-
//#endregion
|
|
35
|
+
export declare function useIsFetching(filters?: Omit<QueryFilters, 'fetchStatus'>, queryClient?: QueryClient): number;
|
|
38
36
|
//# sourceMappingURL=useIsFetching.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsFetching.d.cts","names":[],"sources":["../../src/useIsFetching.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useIsFetching.d.cts","names":[],"sources":["../../src/useIsFetching.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwCgB,cACd,UAAU,KAAK,8BACf,cAAc"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { QueryClient, QueryFilters } from "@tanstack/query-core";
|
|
2
|
-
//#region src/useIsFetching.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The `useIsFetching` hook returns the `number` of the queries that your application is loading or fetching in
|
|
5
4
|
* the background (useful for app-wide loading indicators).
|
|
@@ -33,6 +32,5 @@ import { QueryClient, QueryFilters } from "@tanstack/query-core";
|
|
|
33
32
|
* }
|
|
34
33
|
* ```
|
|
35
34
|
*/
|
|
36
|
-
export declare function useIsFetching(filters?: QueryFilters, queryClient?: QueryClient): number;
|
|
37
|
-
//#endregion
|
|
35
|
+
export declare function useIsFetching(filters?: Omit<QueryFilters, 'fetchStatus'>, queryClient?: QueryClient): number;
|
|
38
36
|
//# sourceMappingURL=useIsFetching.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsFetching.d.ts","names":[],"sources":["../../src/useIsFetching.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useIsFetching.d.ts","names":[],"sources":["../../src/useIsFetching.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwCgB,cACd,UAAU,KAAK,8BACf,cAAc"}
|
|
@@ -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
|
-
|
|
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
|
|
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-
|
|
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
|
-
|
|
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":"
|
|
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":"
|
|
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
|
-
|
|
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-
|
|
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
|
-
|
|
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":"
|
|
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":"
|
|
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
|
-
|
|
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
|
-
|
|
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":"
|
|
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":"
|
|
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
|
-
|
|
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
|
-
|
|
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":"
|
|
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":"
|
|
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
|
-
|
|
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-
|
|
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
|
-
|
|
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
|