@tanstack/vue-query 5.106.1 → 5.107.0

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 (48) hide show
  1. package/build/legacy/index.d.cts +2 -2
  2. package/build/legacy/index.d.ts +2 -2
  3. package/build/legacy/{infiniteQueryOptions-CGWmFi6_.d.ts → infiniteQueryOptions-CN37iZvc.d.ts} +9 -4
  4. package/build/legacy/infiniteQueryOptions-CN37iZvc.d.ts.map +1 -0
  5. package/build/legacy/{infiniteQueryOptions-CkULbee9.d.cts → infiniteQueryOptions-lJ_zR-As.d.cts} +9 -4
  6. package/build/legacy/infiniteQueryOptions-lJ_zR-As.d.cts.map +1 -0
  7. package/build/legacy/infiniteQueryOptions.d.cts +1 -1
  8. package/build/legacy/infiniteQueryOptions.d.ts +1 -1
  9. package/build/legacy/useBaseQuery.d.cts +1 -1
  10. package/build/legacy/useBaseQuery.d.ts +1 -1
  11. package/build/legacy/useInfiniteQuery.cjs.map +1 -1
  12. package/build/legacy/useInfiniteQuery.d.cts +2 -2
  13. package/build/legacy/useInfiniteQuery.d.ts +2 -2
  14. package/build/legacy/useInfiniteQuery.js.map +1 -1
  15. package/build/legacy/useQuery.d.cts +1 -1
  16. package/build/legacy/useQuery.d.ts +1 -1
  17. package/build/legacy/vueQueryPlugin.cjs +2 -0
  18. package/build/legacy/vueQueryPlugin.cjs.map +1 -1
  19. package/build/legacy/vueQueryPlugin.js +2 -0
  20. package/build/legacy/vueQueryPlugin.js.map +1 -1
  21. package/build/modern/index.d.cts +2 -2
  22. package/build/modern/index.d.ts +2 -2
  23. package/build/modern/{infiniteQueryOptions-CGWmFi6_.d.ts → infiniteQueryOptions-CN37iZvc.d.ts} +9 -4
  24. package/build/modern/infiniteQueryOptions-CN37iZvc.d.ts.map +1 -0
  25. package/build/modern/{infiniteQueryOptions-CkULbee9.d.cts → infiniteQueryOptions-lJ_zR-As.d.cts} +9 -4
  26. package/build/modern/infiniteQueryOptions-lJ_zR-As.d.cts.map +1 -0
  27. package/build/modern/infiniteQueryOptions.d.cts +1 -1
  28. package/build/modern/infiniteQueryOptions.d.ts +1 -1
  29. package/build/modern/useBaseQuery.d.cts +1 -1
  30. package/build/modern/useBaseQuery.d.ts +1 -1
  31. package/build/modern/useInfiniteQuery.cjs.map +1 -1
  32. package/build/modern/useInfiniteQuery.d.cts +2 -2
  33. package/build/modern/useInfiniteQuery.d.ts +2 -2
  34. package/build/modern/useInfiniteQuery.js.map +1 -1
  35. package/build/modern/useQuery.d.cts +1 -1
  36. package/build/modern/useQuery.d.ts +1 -1
  37. package/build/modern/vueQueryPlugin.cjs +2 -0
  38. package/build/modern/vueQueryPlugin.cjs.map +1 -1
  39. package/build/modern/vueQueryPlugin.js +2 -0
  40. package/build/modern/vueQueryPlugin.js.map +1 -1
  41. package/package.json +2 -2
  42. package/src/index.ts +1 -0
  43. package/src/useInfiniteQuery.ts +13 -1
  44. package/src/vueQueryPlugin.ts +13 -6
  45. package/build/legacy/infiniteQueryOptions-CGWmFi6_.d.ts.map +0 -1
  46. package/build/legacy/infiniteQueryOptions-CkULbee9.d.cts.map +0 -1
  47. package/build/modern/infiniteQueryOptions-CGWmFi6_.d.ts.map +0 -1
  48. package/build/modern/infiniteQueryOptions-CkULbee9.d.cts.map +0 -1
@@ -4,7 +4,7 @@ import { t as QueryClient } from "./queryClient-BGn8uIej.cjs";
4
4
  import { useQueryClient } from "./useQueryClient.cjs";
5
5
  import { VueQueryPlugin, VueQueryPluginOptions } from "./vueQueryPlugin.cjs";
6
6
  import { QueryCache } from "./queryCache.cjs";
7
- import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, n as UndefinedInitialDataInfiniteOptions, o as useInfiniteQuery, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CkULbee9.cjs";
7
+ import { a as UseInfiniteQueryOptions, i as UseInfiniteQueryDefinedReturnType, n as UndefinedInitialDataInfiniteOptions, o as UseInfiniteQueryReturnType, r as infiniteQueryOptions, s as useInfiniteQuery, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-lJ_zR-As.cjs";
8
8
  import { MutationCache } from "./mutationCache.cjs";
9
9
  import { mutationOptions } from "./mutationOptions.cjs";
10
10
  import { UseQueryDefinedReturnType, UseQueryReturnType, useQuery } from "./useQuery.cjs";
@@ -16,4 +16,4 @@ import { UseIsFetchingFilters, useIsFetching } from "./useIsFetching.cjs";
16
16
  import { MutationStateOptions, UseIsMutatingFilters, useIsMutating, useMutationState } from "./useMutationState.cjs";
17
17
  import { VUE_QUERY_CLIENT } from "./utils.cjs";
18
18
  export * from "@tanstack/query-core";
19
- export { type DefinedInitialDataInfiniteOptions, type DefinedInitialQueryOptions, type DefinedInitialQueryOptionsWithDataTag, MutationCache, type MutationOptions, type MutationResult, type MutationStateOptions, QueryCache, QueryClient, type QueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialQueryOptions, type UndefinedInitialQueryOptionsWithDataTag, type UseInfiniteQueryOptions, type UseInfiniteQueryReturnType, type UseIsFetchingFilters, type UseIsMutatingFilters, type UseMutationOptions, type UseMutationReturnType, type UsePrefetchInfiniteQueryOptions, type UsePrefetchQueryOptions, type UseQueriesOptions, type UseQueriesResults, type UseQueryDefinedReturnType, type UseQueryOptions, type UseQueryReturnType, VUE_QUERY_CLIENT, VueQueryPlugin, type VueQueryPluginOptions, infiniteQueryOptions, mutationOptions, queryOptions, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useMutationState, usePrefetchInfiniteQuery, usePrefetchQuery, useQueries, useQuery, useQueryClient };
19
+ export { type DefinedInitialDataInfiniteOptions, type DefinedInitialQueryOptions, type DefinedInitialQueryOptionsWithDataTag, MutationCache, type MutationOptions, type MutationResult, type MutationStateOptions, QueryCache, QueryClient, type QueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialQueryOptions, type UndefinedInitialQueryOptionsWithDataTag, type UseInfiniteQueryDefinedReturnType, type UseInfiniteQueryOptions, type UseInfiniteQueryReturnType, type UseIsFetchingFilters, type UseIsMutatingFilters, type UseMutationOptions, type UseMutationReturnType, type UsePrefetchInfiniteQueryOptions, type UsePrefetchQueryOptions, type UseQueriesOptions, type UseQueriesResults, type UseQueryDefinedReturnType, type UseQueryOptions, type UseQueryReturnType, VUE_QUERY_CLIENT, VueQueryPlugin, type VueQueryPluginOptions, infiniteQueryOptions, mutationOptions, queryOptions, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useMutationState, usePrefetchInfiniteQuery, usePrefetchQuery, useQueries, useQuery, useQueryClient };
@@ -4,7 +4,7 @@ import { t as QueryClient } from "./queryClient-Ba4HSFnn.js";
4
4
  import { useQueryClient } from "./useQueryClient.js";
5
5
  import { VueQueryPlugin, VueQueryPluginOptions } from "./vueQueryPlugin.js";
6
6
  import { QueryCache } from "./queryCache.js";
7
- import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, n as UndefinedInitialDataInfiniteOptions, o as useInfiniteQuery, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CGWmFi6_.js";
7
+ import { a as UseInfiniteQueryOptions, i as UseInfiniteQueryDefinedReturnType, n as UndefinedInitialDataInfiniteOptions, o as UseInfiniteQueryReturnType, r as infiniteQueryOptions, s as useInfiniteQuery, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CN37iZvc.js";
8
8
  import { MutationCache } from "./mutationCache.js";
9
9
  import { mutationOptions } from "./mutationOptions.js";
10
10
  import { UseQueryDefinedReturnType, UseQueryReturnType, useQuery } from "./useQuery.js";
@@ -16,4 +16,4 @@ import { UseIsFetchingFilters, useIsFetching } from "./useIsFetching.js";
16
16
  import { MutationStateOptions, UseIsMutatingFilters, useIsMutating, useMutationState } from "./useMutationState.js";
17
17
  import { VUE_QUERY_CLIENT } from "./utils.js";
18
18
  export * from "@tanstack/query-core";
19
- export { type DefinedInitialDataInfiniteOptions, type DefinedInitialQueryOptions, type DefinedInitialQueryOptionsWithDataTag, MutationCache, type MutationOptions, type MutationResult, type MutationStateOptions, QueryCache, QueryClient, type QueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialQueryOptions, type UndefinedInitialQueryOptionsWithDataTag, type UseInfiniteQueryOptions, type UseInfiniteQueryReturnType, type UseIsFetchingFilters, type UseIsMutatingFilters, type UseMutationOptions, type UseMutationReturnType, type UsePrefetchInfiniteQueryOptions, type UsePrefetchQueryOptions, type UseQueriesOptions, type UseQueriesResults, type UseQueryDefinedReturnType, type UseQueryOptions, type UseQueryReturnType, VUE_QUERY_CLIENT, VueQueryPlugin, type VueQueryPluginOptions, infiniteQueryOptions, mutationOptions, queryOptions, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useMutationState, usePrefetchInfiniteQuery, usePrefetchQuery, useQueries, useQuery, useQueryClient };
19
+ export { type DefinedInitialDataInfiniteOptions, type DefinedInitialQueryOptions, type DefinedInitialQueryOptionsWithDataTag, MutationCache, type MutationOptions, type MutationResult, type MutationStateOptions, QueryCache, QueryClient, type QueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialQueryOptions, type UndefinedInitialQueryOptionsWithDataTag, type UseInfiniteQueryDefinedReturnType, type UseInfiniteQueryOptions, type UseInfiniteQueryReturnType, type UseIsFetchingFilters, type UseIsMutatingFilters, type UseMutationOptions, type UseMutationReturnType, type UsePrefetchInfiniteQueryOptions, type UsePrefetchQueryOptions, type UseQueriesOptions, type UseQueriesResults, type UseQueryDefinedReturnType, type UseQueryOptions, type UseQueryReturnType, VUE_QUERY_CLIENT, VueQueryPlugin, type VueQueryPluginOptions, infiniteQueryOptions, mutationOptions, queryOptions, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useMutationState, usePrefetchInfiniteQuery, usePrefetchQuery, useQueries, useQuery, useQueryClient };
@@ -1,7 +1,7 @@
1
1
  import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-u_Tu5Ybs.js";
2
2
  import { o as UseQueryOptions } from "./queryOptions-dXiBZnGk.js";
3
3
  import { t as QueryClient$1 } from "./queryClient-Ba4HSFnn.js";
4
- import { DefaultError, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
4
+ import { DefaultError, DefinedInfiniteQueryObserverResult, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
5
5
  import { Ref } from "vue-demi";
6
6
  /**
7
7
  * The result of the query composables: every property of the observer result wrapped in a `Ref`, except
@@ -39,6 +39,11 @@ type UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TDat
39
39
  * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.
40
40
  */
41
41
  type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, InfiniteQueryObserverResult<TData, TError>>;
42
+ /**
43
+ * The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined` (unless a `select`
44
+ * changes `TData` to include `undefined`).
45
+ */
46
+ type UseInfiniteQueryDefinedReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, DefinedInfiniteQueryObserverResult<TData, TError>>;
42
47
  /**
43
48
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
44
49
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
@@ -86,7 +91,7 @@ type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, T
86
91
  * </template>
87
92
  * ```
88
93
  */
89
- declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: MaybeRefOrGetter<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseInfiniteQueryReturnType<TData, TError>;
94
+ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: MaybeRefOrGetter<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseInfiniteQueryDefinedReturnType<TData, TError>;
90
95
  /**
91
96
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
92
97
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
@@ -365,5 +370,5 @@ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData
365
370
  * ```
366
371
  */
367
372
  declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>;
368
- export { UseInfiniteQueryReturnType as a, useBaseQuery as c, UseInfiniteQueryOptions as i, UndefinedInitialDataInfiniteOptions as n, useInfiniteQuery as o, infiniteQueryOptions as r, UseBaseQueryReturnType as s, DefinedInitialDataInfiniteOptions as t };
369
- //# sourceMappingURL=infiniteQueryOptions-CGWmFi6_.d.ts.map
373
+ export { UseInfiniteQueryOptions as a, UseBaseQueryReturnType as c, UseInfiniteQueryDefinedReturnType as i, useBaseQuery as l, UndefinedInitialDataInfiniteOptions as n, UseInfiniteQueryReturnType as o, infiniteQueryOptions as r, useInfiniteQuery as s, DefinedInitialDataInfiniteOptions as t };
374
+ //# sourceMappingURL=infiniteQueryOptions-CN37iZvc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infiniteQueryOptions-CN37iZvc.d.ts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;;;;KA8BY,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAIlB,QAAQ,KACR,IAAI,SAAS,SAAS;;;;;;;;;EAU1B,gBAAgB,QAAQ;;KAGrB,uBACH,cACA,QACA,OACA,YACA,kBAAkB,WAAW,UAC7B,wBAEE,gBAAgB,cAAc,QAAQ,OAAO,YAAY,aACzD,wBAAwB,cAAc,QAAQ,OAAO,WAAW;;;;;;;;;iBAUpD,aACd,cACA,QACA,OACA,YACA,kBAAkB,UAClB,YAEA,iBAAiB,eACjB,SAAS,iBACP,uBACE,cACA,QACA,OACA,YACA,WACA,cAGJ,cAAcA,gBACb,uBAAuB,OAAO;;;;;;KC5DrB,wBACV,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,wBACE,YAGE,kBAAkB,6BAChB,cACA,QACA,OACA,WACA,cAED,6BACC,iBACE,6BACE,cACA,QACA,OACA,cAAc,YACd,YACA,aAEJ,aACE,6BACE,cACA,QACA,OACA,cAAc,YACd,YACA,gBAEN;;;;;KAOM,2BAA2B,OAAO,UAAU,uBACtD,OACA,QACA,4BAA4B,OAAO;;;;;KAOzB,kCAAkC,OAAO,UACnD,uBACE,OACA,QACA,mCAAmC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkD9B,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,kCACE,cACA,QACA,OACA,WACA,cAGJ,cAAcC,gBACb,kCAAkC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-u_Tu5Ybs.cjs";
2
2
  import { o as UseQueryOptions } from "./queryOptions-BuZEBLtg.cjs";
3
3
  import { t as QueryClient$1 } from "./queryClient-BGn8uIej.cjs";
4
- import { DefaultError, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
4
+ import { DefaultError, DefinedInfiniteQueryObserverResult, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
5
5
  import { Ref } from "vue-demi";
6
6
  /**
7
7
  * The result of the query composables: every property of the observer result wrapped in a `Ref`, except
@@ -39,6 +39,11 @@ type UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TDat
39
39
  * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.
40
40
  */
41
41
  type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, InfiniteQueryObserverResult<TData, TError>>;
42
+ /**
43
+ * The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined` (unless a `select`
44
+ * changes `TData` to include `undefined`).
45
+ */
46
+ type UseInfiniteQueryDefinedReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, DefinedInfiniteQueryObserverResult<TData, TError>>;
42
47
  /**
43
48
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
44
49
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
@@ -86,7 +91,7 @@ type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, T
86
91
  * </template>
87
92
  * ```
88
93
  */
89
- declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: MaybeRefOrGetter<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseInfiniteQueryReturnType<TData, TError>;
94
+ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: MaybeRefOrGetter<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseInfiniteQueryDefinedReturnType<TData, TError>;
90
95
  /**
91
96
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
92
97
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
@@ -365,5 +370,5 @@ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData
365
370
  * ```
366
371
  */
367
372
  declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>;
368
- export { UseInfiniteQueryReturnType as a, useBaseQuery as c, UseInfiniteQueryOptions as i, UndefinedInitialDataInfiniteOptions as n, useInfiniteQuery as o, infiniteQueryOptions as r, UseBaseQueryReturnType as s, DefinedInitialDataInfiniteOptions as t };
369
- //# sourceMappingURL=infiniteQueryOptions-CkULbee9.d.cts.map
373
+ export { UseInfiniteQueryOptions as a, UseBaseQueryReturnType as c, UseInfiniteQueryDefinedReturnType as i, useBaseQuery as l, UndefinedInitialDataInfiniteOptions as n, UseInfiniteQueryReturnType as o, infiniteQueryOptions as r, useInfiniteQuery as s, DefinedInitialDataInfiniteOptions as t };
374
+ //# sourceMappingURL=infiniteQueryOptions-lJ_zR-As.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infiniteQueryOptions-lJ_zR-As.d.cts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;;;;KA8BY,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAIlB,QAAQ,KACR,IAAI,SAAS,SAAS;;;;;;;;;EAU1B,gBAAgB,QAAQ;;KAGrB,uBACH,cACA,QACA,OACA,YACA,kBAAkB,WAAW,UAC7B,wBAEE,gBAAgB,cAAc,QAAQ,OAAO,YAAY,aACzD,wBAAwB,cAAc,QAAQ,OAAO,WAAW;;;;;;;;;iBAUpD,aACd,cACA,QACA,OACA,YACA,kBAAkB,UAClB,YAEA,iBAAiB,eACjB,SAAS,iBACP,uBACE,cACA,QACA,OACA,YACA,WACA,cAGJ,cAAcA,gBACb,uBAAuB,OAAO;;;;;;KC5DrB,wBACV,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,wBACE,YAGE,kBAAkB,6BAChB,cACA,QACA,OACA,WACA,cAED,6BACC,iBACE,6BACE,cACA,QACA,OACA,cAAc,YACd,YACA,aAEJ,aACE,6BACE,cACA,QACA,OACA,cAAc,YACd,YACA,gBAEN;;;;;KAOM,2BAA2B,OAAO,UAAU,uBACtD,OACA,QACA,4BAA4B,OAAO;;;;;KAOzB,kCAAkC,OAAO,UACnD,uBACE,OACA,QACA,mCAAmC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkD9B,iBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,kCACE,cACA,QACA,OACA,WACA,cAGJ,cAAcC,gBACb,kCAAkC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BAAoB,WAAW,aAAa,eAAe"}
@@ -1,2 +1,2 @@
1
- import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CkULbee9.cjs";
1
+ import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-lJ_zR-As.cjs";
2
2
  export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, infiniteQueryOptions };
@@ -1,2 +1,2 @@
1
- import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CGWmFi6_.js";
1
+ import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CN37iZvc.js";
2
2
  export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, infiniteQueryOptions };
@@ -1,2 +1,2 @@
1
- import { c as useBaseQuery, s as UseBaseQueryReturnType } from "./infiniteQueryOptions-CkULbee9.cjs";
1
+ import { c as UseBaseQueryReturnType, l as useBaseQuery } from "./infiniteQueryOptions-lJ_zR-As.cjs";
2
2
  export { UseBaseQueryReturnType, useBaseQuery };
@@ -1,2 +1,2 @@
1
- import { c as useBaseQuery, s as UseBaseQueryReturnType } from "./infiniteQueryOptions-CGWmFi6_.js";
1
+ import { c as UseBaseQueryReturnType, l as useBaseQuery } from "./infiniteQueryOptions-CN37iZvc.js";
2
2
  export { UseBaseQueryReturnType, useBaseQuery };
@@ -1 +1 @@
1
- {"version":3,"file":"useInfiniteQuery.cjs","names":["useBaseQuery","InfiniteQueryObserver"],"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\n\nimport type { UseBaseQueryReturnType } from './useBaseQuery'\n\nimport type {\n DeepUnwrapRef,\n MaybeRef,\n MaybeRefDeep,\n MaybeRefOrGetter,\n ShallowOption,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\n/**\n * The options accepted by `useInfiniteQuery`. Same as {@link InfiniteQueryObserverOptions} from\n * `@tanstack/query-core`, plus the `shallow` option. Each option except `shallow` can also be a `ref` (and\n * `enabled` a reactive getter).\n */\nexport type UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = MaybeRef<\n {\n [\n Property in keyof InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n ]: Property extends 'enabled'\n ? MaybeRefOrGetter<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n : MaybeRefDeep<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n } & ShallowOption\n>\n\n/**\n * The result of `useInfiniteQuery`: {@link InfiniteQueryObserverResult} from `@tanstack/query-core`, with\n * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.\n */\nexport type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<\n TData,\n TError,\n InfiniteQueryObserverResult<TData, TError>\n>\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, so the resulting `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` known to be defined.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * Fetching the next page from a \"Load More\" button click:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <button @click=\"fetchNextPage()\" :disabled=\"!hasNextPage || isFetching\">\n * {{ isFetchingNextPage ? 'Loading more...' : hasNextPage ? 'Load More' : 'Nothing more to load' }}\n * </button>\n * </template>\n * </template>\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 * ```vue\n * <script setup lang=\"ts\">\n * import { onUnmounted, ref, watch } from 'vue'\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 sentinel = ref<HTMLElement>()\n * let observer: IntersectionObserver | undefined\n *\n * watch(sentinel, (el) => {\n * observer?.disconnect()\n * if (el == null) return\n *\n * observer = new IntersectionObserver(([entry]) => {\n * if (entry?.isIntersecting && hasNextPage.value && !isFetching.value) {\n * fetchNextPage()\n * }\n * })\n * observer.observe(el)\n * })\n *\n * onUnmounted(() => observer?.disconnect())\n * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <div ref=\"sentinel\">{{ isFetchingNextPage ? 'Loading more...' : '' }}</div>\n * </template>\n * </template>\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: MaybeRefOrGetter<\n UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\n/**\n * Fallback overload for options whose `initialData` presence isn't statically known — for example, a\n * `ref`/reactive object built up conditionally, rather than a plain object literal. Prefer one of the other\n * overloads when possible, since they infer whether `data` can be `undefined` from `initialData` directly.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - A `ref`, plain value, or reactive getter resolving to the {@link UseInfiniteQueryOptions} to\n * use.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`.\n * @example\n * Passing a whole-options getter so `maxPages` reacts to a setting stored elsewhere, not just `queryKey`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ projectId: number; maxPages: number }>()\n *\n * const { data } = useInfiniteQuery(() => ({\n * queryKey: ['project', props.projectId, 'issues'],\n * queryFn: ({ pageParam }) => fetchIssues(props.projectId, pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * maxPages: props.maxPages,\n * }))\n * </script>\n *\n * <template>\n * <template v-for=\"page in data?.pages\" :key=\"page.nextId\">\n * <li v-for=\"issue in page.issues\" :key=\"issue.id\">{{ issue.title }}</li>\n * </template>\n * </template>\n * ```\n * @example\n * A query that's disabled, type-safe, until `postId` is set — pass `skipToken` as `queryFn` instead of\n * setting `enabled: false`. This requires a whole-options getter: `queryFn` isn't itself reactive, so the\n * getter is what re-evaluates it on every change to `props.postId`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { skipToken, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: string | undefined }>()\n *\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 * const postId = props.postId\n * return {\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 * </script>\n *\n * <template>\n * <span v-if=\"props.postId == null\">Select a post</span>\n * <span v-else-if=\"isLoading\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <ul v-else>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"comment in page.comments\" :key=\"comment.id\">{{ comment.text }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\nexport function useInfiniteQuery(\n options: MaybeRefOrGetter<UseInfiniteQueryOptions>,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n InfiniteQueryObserver as typeof QueryObserver,\n options,\n queryClient,\n )\n}\n"],"mappings":";;;;AA2WA,SAAgB,iBACd,SACA,aACA;CACA,OAAOA,qBAAAA,aACLC,qBAAAA,uBACA,SACA,WACF;AACF"}
1
+ {"version":3,"file":"useInfiniteQuery.cjs","names":["useBaseQuery","InfiniteQueryObserver"],"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\nimport type {\n DefaultError,\n DefinedInfiniteQueryObserverResult,\n InfiniteData,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\n\nimport type { UseBaseQueryReturnType } from './useBaseQuery'\n\nimport type {\n DeepUnwrapRef,\n MaybeRef,\n MaybeRefDeep,\n MaybeRefOrGetter,\n ShallowOption,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\n/**\n * The options accepted by `useInfiniteQuery`. Same as {@link InfiniteQueryObserverOptions} from\n * `@tanstack/query-core`, plus the `shallow` option. Each option except `shallow` can also be a `ref` (and\n * `enabled` a reactive getter).\n */\nexport type UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = MaybeRef<\n {\n [\n Property in keyof InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n ]: Property extends 'enabled'\n ? MaybeRefOrGetter<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n : MaybeRefDeep<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n } & ShallowOption\n>\n\n/**\n * The result of `useInfiniteQuery`: {@link InfiniteQueryObserverResult} from `@tanstack/query-core`, with\n * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.\n */\nexport type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<\n TData,\n TError,\n InfiniteQueryObserverResult<TData, TError>\n>\n\n/**\n * The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined` (unless a `select`\n * changes `TData` to include `undefined`).\n */\nexport type UseInfiniteQueryDefinedReturnType<TData, TError> =\n UseBaseQueryReturnType<\n TData,\n TError,\n DefinedInfiniteQueryObserverResult<TData, TError>\n >\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, so the resulting `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` known to be defined.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryDefinedReturnType<TData, TError>\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * Fetching the next page from a \"Load More\" button click:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <button @click=\"fetchNextPage()\" :disabled=\"!hasNextPage || isFetching\">\n * {{ isFetchingNextPage ? 'Loading more...' : hasNextPage ? 'Load More' : 'Nothing more to load' }}\n * </button>\n * </template>\n * </template>\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 * ```vue\n * <script setup lang=\"ts\">\n * import { onUnmounted, ref, watch } from 'vue'\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 sentinel = ref<HTMLElement>()\n * let observer: IntersectionObserver | undefined\n *\n * watch(sentinel, (el) => {\n * observer?.disconnect()\n * if (el == null) return\n *\n * observer = new IntersectionObserver(([entry]) => {\n * if (entry?.isIntersecting && hasNextPage.value && !isFetching.value) {\n * fetchNextPage()\n * }\n * })\n * observer.observe(el)\n * })\n *\n * onUnmounted(() => observer?.disconnect())\n * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <div ref=\"sentinel\">{{ isFetchingNextPage ? 'Loading more...' : '' }}</div>\n * </template>\n * </template>\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: MaybeRefOrGetter<\n UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\n/**\n * Fallback overload for options whose `initialData` presence isn't statically known — for example, a\n * `ref`/reactive object built up conditionally, rather than a plain object literal. Prefer one of the other\n * overloads when possible, since they infer whether `data` can be `undefined` from `initialData` directly.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - A `ref`, plain value, or reactive getter resolving to the {@link UseInfiniteQueryOptions} to\n * use.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`.\n * @example\n * Passing a whole-options getter so `maxPages` reacts to a setting stored elsewhere, not just `queryKey`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ projectId: number; maxPages: number }>()\n *\n * const { data } = useInfiniteQuery(() => ({\n * queryKey: ['project', props.projectId, 'issues'],\n * queryFn: ({ pageParam }) => fetchIssues(props.projectId, pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * maxPages: props.maxPages,\n * }))\n * </script>\n *\n * <template>\n * <template v-for=\"page in data?.pages\" :key=\"page.nextId\">\n * <li v-for=\"issue in page.issues\" :key=\"issue.id\">{{ issue.title }}</li>\n * </template>\n * </template>\n * ```\n * @example\n * A query that's disabled, type-safe, until `postId` is set — pass `skipToken` as `queryFn` instead of\n * setting `enabled: false`. This requires a whole-options getter: `queryFn` isn't itself reactive, so the\n * getter is what re-evaluates it on every change to `props.postId`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { skipToken, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: string | undefined }>()\n *\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 * const postId = props.postId\n * return {\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 * </script>\n *\n * <template>\n * <span v-if=\"props.postId == null\">Select a post</span>\n * <span v-else-if=\"isLoading\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <ul v-else>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"comment in page.comments\" :key=\"comment.id\">{{ comment.text }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\nexport function useInfiniteQuery(\n options: MaybeRefOrGetter<UseInfiniteQueryOptions>,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n InfiniteQueryObserver as typeof QueryObserver,\n options,\n queryClient,\n )\n}\n"],"mappings":";;;;AAuXA,SAAgB,iBACd,SACA,aACA;CACA,OAAOA,qBAAAA,aACLC,qBAAAA,uBACA,SACA,WACF;AACF"}
@@ -1,2 +1,2 @@
1
- import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, o as useInfiniteQuery } from "./infiniteQueryOptions-CkULbee9.cjs";
2
- export { UseInfiniteQueryOptions, UseInfiniteQueryReturnType, useInfiniteQuery };
1
+ import { a as UseInfiniteQueryOptions, i as UseInfiniteQueryDefinedReturnType, o as UseInfiniteQueryReturnType, s as useInfiniteQuery } from "./infiniteQueryOptions-lJ_zR-As.cjs";
2
+ export { UseInfiniteQueryDefinedReturnType, UseInfiniteQueryOptions, UseInfiniteQueryReturnType, useInfiniteQuery };
@@ -1,2 +1,2 @@
1
- import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, o as useInfiniteQuery } from "./infiniteQueryOptions-CGWmFi6_.js";
2
- export { UseInfiniteQueryOptions, UseInfiniteQueryReturnType, useInfiniteQuery };
1
+ import { a as UseInfiniteQueryOptions, i as UseInfiniteQueryDefinedReturnType, o as UseInfiniteQueryReturnType, s as useInfiniteQuery } from "./infiniteQueryOptions-CN37iZvc.js";
2
+ export { UseInfiniteQueryDefinedReturnType, UseInfiniteQueryOptions, UseInfiniteQueryReturnType, useInfiniteQuery };
@@ -1 +1 @@
1
- {"version":3,"file":"useInfiniteQuery.js","names":[],"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\n\nimport type { UseBaseQueryReturnType } from './useBaseQuery'\n\nimport type {\n DeepUnwrapRef,\n MaybeRef,\n MaybeRefDeep,\n MaybeRefOrGetter,\n ShallowOption,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\n/**\n * The options accepted by `useInfiniteQuery`. Same as {@link InfiniteQueryObserverOptions} from\n * `@tanstack/query-core`, plus the `shallow` option. Each option except `shallow` can also be a `ref` (and\n * `enabled` a reactive getter).\n */\nexport type UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = MaybeRef<\n {\n [\n Property in keyof InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n ]: Property extends 'enabled'\n ? MaybeRefOrGetter<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n : MaybeRefDeep<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n } & ShallowOption\n>\n\n/**\n * The result of `useInfiniteQuery`: {@link InfiniteQueryObserverResult} from `@tanstack/query-core`, with\n * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.\n */\nexport type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<\n TData,\n TError,\n InfiniteQueryObserverResult<TData, TError>\n>\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, so the resulting `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` known to be defined.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * Fetching the next page from a \"Load More\" button click:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <button @click=\"fetchNextPage()\" :disabled=\"!hasNextPage || isFetching\">\n * {{ isFetchingNextPage ? 'Loading more...' : hasNextPage ? 'Load More' : 'Nothing more to load' }}\n * </button>\n * </template>\n * </template>\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 * ```vue\n * <script setup lang=\"ts\">\n * import { onUnmounted, ref, watch } from 'vue'\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 sentinel = ref<HTMLElement>()\n * let observer: IntersectionObserver | undefined\n *\n * watch(sentinel, (el) => {\n * observer?.disconnect()\n * if (el == null) return\n *\n * observer = new IntersectionObserver(([entry]) => {\n * if (entry?.isIntersecting && hasNextPage.value && !isFetching.value) {\n * fetchNextPage()\n * }\n * })\n * observer.observe(el)\n * })\n *\n * onUnmounted(() => observer?.disconnect())\n * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <div ref=\"sentinel\">{{ isFetchingNextPage ? 'Loading more...' : '' }}</div>\n * </template>\n * </template>\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: MaybeRefOrGetter<\n UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\n/**\n * Fallback overload for options whose `initialData` presence isn't statically known — for example, a\n * `ref`/reactive object built up conditionally, rather than a plain object literal. Prefer one of the other\n * overloads when possible, since they infer whether `data` can be `undefined` from `initialData` directly.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - A `ref`, plain value, or reactive getter resolving to the {@link UseInfiniteQueryOptions} to\n * use.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`.\n * @example\n * Passing a whole-options getter so `maxPages` reacts to a setting stored elsewhere, not just `queryKey`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ projectId: number; maxPages: number }>()\n *\n * const { data } = useInfiniteQuery(() => ({\n * queryKey: ['project', props.projectId, 'issues'],\n * queryFn: ({ pageParam }) => fetchIssues(props.projectId, pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * maxPages: props.maxPages,\n * }))\n * </script>\n *\n * <template>\n * <template v-for=\"page in data?.pages\" :key=\"page.nextId\">\n * <li v-for=\"issue in page.issues\" :key=\"issue.id\">{{ issue.title }}</li>\n * </template>\n * </template>\n * ```\n * @example\n * A query that's disabled, type-safe, until `postId` is set — pass `skipToken` as `queryFn` instead of\n * setting `enabled: false`. This requires a whole-options getter: `queryFn` isn't itself reactive, so the\n * getter is what re-evaluates it on every change to `props.postId`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { skipToken, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: string | undefined }>()\n *\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 * const postId = props.postId\n * return {\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 * </script>\n *\n * <template>\n * <span v-if=\"props.postId == null\">Select a post</span>\n * <span v-else-if=\"isLoading\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <ul v-else>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"comment in page.comments\" :key=\"comment.id\">{{ comment.text }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\nexport function useInfiniteQuery(\n options: MaybeRefOrGetter<UseInfiniteQueryOptions>,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n InfiniteQueryObserver as typeof QueryObserver,\n options,\n queryClient,\n )\n}\n"],"mappings":";;;AA2WA,SAAgB,iBACd,SACA,aACA;CACA,OAAO,aACL,uBACA,SACA,WACF;AACF"}
1
+ {"version":3,"file":"useInfiniteQuery.js","names":[],"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\nimport type {\n DefaultError,\n DefinedInfiniteQueryObserverResult,\n InfiniteData,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\n\nimport type { UseBaseQueryReturnType } from './useBaseQuery'\n\nimport type {\n DeepUnwrapRef,\n MaybeRef,\n MaybeRefDeep,\n MaybeRefOrGetter,\n ShallowOption,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\n/**\n * The options accepted by `useInfiniteQuery`. Same as {@link InfiniteQueryObserverOptions} from\n * `@tanstack/query-core`, plus the `shallow` option. Each option except `shallow` can also be a `ref` (and\n * `enabled` a reactive getter).\n */\nexport type UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = MaybeRef<\n {\n [\n Property in keyof InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n ]: Property extends 'enabled'\n ? MaybeRefOrGetter<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n : MaybeRefDeep<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n } & ShallowOption\n>\n\n/**\n * The result of `useInfiniteQuery`: {@link InfiniteQueryObserverResult} from `@tanstack/query-core`, with\n * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.\n */\nexport type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<\n TData,\n TError,\n InfiniteQueryObserverResult<TData, TError>\n>\n\n/**\n * The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined` (unless a `select`\n * changes `TData` to include `undefined`).\n */\nexport type UseInfiniteQueryDefinedReturnType<TData, TError> =\n UseBaseQueryReturnType<\n TData,\n TError,\n DefinedInfiniteQueryObserverResult<TData, TError>\n >\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, so the resulting `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` known to be defined.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryDefinedReturnType<TData, TError>\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * Fetching the next page from a \"Load More\" button click:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <button @click=\"fetchNextPage()\" :disabled=\"!hasNextPage || isFetching\">\n * {{ isFetchingNextPage ? 'Loading more...' : hasNextPage ? 'Load More' : 'Nothing more to load' }}\n * </button>\n * </template>\n * </template>\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 * ```vue\n * <script setup lang=\"ts\">\n * import { onUnmounted, ref, watch } from 'vue'\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 sentinel = ref<HTMLElement>()\n * let observer: IntersectionObserver | undefined\n *\n * watch(sentinel, (el) => {\n * observer?.disconnect()\n * if (el == null) return\n *\n * observer = new IntersectionObserver(([entry]) => {\n * if (entry?.isIntersecting && hasNextPage.value && !isFetching.value) {\n * fetchNextPage()\n * }\n * })\n * observer.observe(el)\n * })\n *\n * onUnmounted(() => observer?.disconnect())\n * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <div ref=\"sentinel\">{{ isFetchingNextPage ? 'Loading more...' : '' }}</div>\n * </template>\n * </template>\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: MaybeRefOrGetter<\n UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\n/**\n * Fallback overload for options whose `initialData` presence isn't statically known — for example, a\n * `ref`/reactive object built up conditionally, rather than a plain object literal. Prefer one of the other\n * overloads when possible, since they infer whether `data` can be `undefined` from `initialData` directly.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - A `ref`, plain value, or reactive getter resolving to the {@link UseInfiniteQueryOptions} to\n * use.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`.\n * @example\n * Passing a whole-options getter so `maxPages` reacts to a setting stored elsewhere, not just `queryKey`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ projectId: number; maxPages: number }>()\n *\n * const { data } = useInfiniteQuery(() => ({\n * queryKey: ['project', props.projectId, 'issues'],\n * queryFn: ({ pageParam }) => fetchIssues(props.projectId, pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * maxPages: props.maxPages,\n * }))\n * </script>\n *\n * <template>\n * <template v-for=\"page in data?.pages\" :key=\"page.nextId\">\n * <li v-for=\"issue in page.issues\" :key=\"issue.id\">{{ issue.title }}</li>\n * </template>\n * </template>\n * ```\n * @example\n * A query that's disabled, type-safe, until `postId` is set — pass `skipToken` as `queryFn` instead of\n * setting `enabled: false`. This requires a whole-options getter: `queryFn` isn't itself reactive, so the\n * getter is what re-evaluates it on every change to `props.postId`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { skipToken, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: string | undefined }>()\n *\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 * const postId = props.postId\n * return {\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 * </script>\n *\n * <template>\n * <span v-if=\"props.postId == null\">Select a post</span>\n * <span v-else-if=\"isLoading\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <ul v-else>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"comment in page.comments\" :key=\"comment.id\">{{ comment.text }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\nexport function useInfiniteQuery(\n options: MaybeRefOrGetter<UseInfiniteQueryOptions>,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n InfiniteQueryObserver as typeof QueryObserver,\n options,\n queryClient,\n )\n}\n"],"mappings":";;;AAuXA,SAAgB,iBACd,SACA,aACA;CACA,OAAO,aACL,uBACA,SACA,WACF;AACF"}
@@ -1,7 +1,7 @@
1
1
  import { s as MaybeRefOrGetter } from "./types-u_Tu5Ybs.cjs";
2
2
  import { i as UndefinedInitialQueryOptions, o as UseQueryOptions, t as DefinedInitialQueryOptions } from "./queryOptions-BuZEBLtg.cjs";
3
3
  import { t as QueryClient$1 } from "./queryClient-BGn8uIej.cjs";
4
- import { s as UseBaseQueryReturnType } from "./infiniteQueryOptions-CkULbee9.cjs";
4
+ import { c as UseBaseQueryReturnType } from "./infiniteQueryOptions-lJ_zR-As.cjs";
5
5
  import { DefaultError, DefinedQueryObserverResult, QueryKey } from "@tanstack/query-core";
6
6
  /**
7
7
  * The result of `useQuery` when `initialData` is omitted, may be `undefined`, or is a function that may
@@ -1,7 +1,7 @@
1
1
  import { s as MaybeRefOrGetter } from "./types-u_Tu5Ybs.js";
2
2
  import { i as UndefinedInitialQueryOptions, o as UseQueryOptions, t as DefinedInitialQueryOptions } from "./queryOptions-dXiBZnGk.js";
3
3
  import { t as QueryClient$1 } from "./queryClient-Ba4HSFnn.js";
4
- import { s as UseBaseQueryReturnType } from "./infiniteQueryOptions-CGWmFi6_.js";
4
+ import { c as UseBaseQueryReturnType } from "./infiniteQueryOptions-CN37iZvc.js";
5
5
  import { DefaultError, DefinedQueryObserverResult, QueryKey } from "@tanstack/query-core";
6
6
  /**
7
7
  * The result of `useQuery` when `initialData` is omitted, may be `undefined`, or is a function that may
@@ -54,6 +54,8 @@ const VueQueryPlugin = { install: (app, options = {}) => {
54
54
  var _options$clientPersis;
55
55
  if (client.isRestoring) client.isRestoring.value = false;
56
56
  (_options$clientPersis = options.clientPersisterOnSuccess) === null || _options$clientPersis === void 0 || _options$clientPersis.call(options, client);
57
+ }, () => {
58
+ if (client.isRestoring) client.isRestoring.value = false;
57
59
  });
58
60
  }
59
61
  const cleanup = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"vueQueryPlugin.cjs","names":["getClientKey","QueryClient","environmentManager","isVue2"],"sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { environmentManager } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n /** Enables the legacy Vue Devtools v6 plugin panel. Prefer `@tanstack/vue-query-devtools` for Vue 3 apps. */\n enableDevtoolsV6Plugin?: boolean\n /**\n * Distinguishes multiple `QueryClient`s provided in the same app — pass the same key to `useQueryClient` to\n * pick this one. Only needed when installing more than one client.\n */\n queryClientKey?: string\n /**\n * Restores a persisted cache before the app mounts. While it runs, `queryClient.isRestoring` is `true`, which\n * suppresses fetches — see `usePersistQueryClient` in `@tanstack/query-persist-client-core` for building one.\n */\n clientPersister?: ClientPersister\n /** Called once `clientPersister`'s returned promise resolves and the cache has finished restoring. */\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n /** Options for the `QueryClient` the plugin constructs. Ignored if `queryClient` is also set. */\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */\n queryClient?: QueryClient\n}\n\n/**\n * The options accepted by `VueQueryPlugin`: either a `queryClient` to install, or a `queryClientConfig` for the\n * client the plugin creates, plus the shared options.\n */\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\n/**\n * Installs a `QueryClient` on the Vue app, making it available to every descendant component through\n * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin\n * instead of a wrapping component.\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import { VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const app = createApp(App)\n * app.use(VueQueryPlugin)\n * ```\n * @example\n * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per\n * request, or when the same instance also needs to be used outside of Vue components:\n * ```ts\n * import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const queryClient = new QueryClient()\n * app.use(VueQueryPlugin, { queryClient })\n * ```\n * @example\n * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:\n * ```ts\n * app.use(VueQueryPlugin, {\n * queryClientConfig: {\n * defaultOptions: { queries: { staleTime: 5 * 1000 } },\n * },\n * })\n * ```\n */\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!environmentManager.isServer()) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n if (client.isRestoring) {\n client.isRestoring.value = true\n }\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n options.clientPersisterOnSuccess?.(client)\n })\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root && options.enableDevtoolsV6Plugin) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n if (options.enableDevtoolsV6Plugin) {\n setupDevtools(app, client)\n }\n }\n }\n },\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAa,iBAAiB,EAC5B,UAAU,KAAU,UAAiC,CAAC,MAAM;CAC1D,MAAM,YAAYA,cAAAA,aAAa,QAAQ,cAAc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K,MAAM;EAAA;CAG/B;AACF,EACF"}
1
+ {"version":3,"file":"vueQueryPlugin.cjs","names":["getClientKey","QueryClient","environmentManager","isVue2"],"sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { environmentManager } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n /** Enables the legacy Vue Devtools v6 plugin panel. Prefer `@tanstack/vue-query-devtools` for Vue 3 apps. */\n enableDevtoolsV6Plugin?: boolean\n /**\n * Distinguishes multiple `QueryClient`s provided in the same app — pass the same key to `useQueryClient` to\n * pick this one. Only needed when installing more than one client.\n */\n queryClientKey?: string\n /**\n * Restores a persisted cache before the app mounts. While it runs, `queryClient.isRestoring` is `true`, which\n * suppresses fetches — see `usePersistQueryClient` in `@tanstack/query-persist-client-core` for building one.\n */\n clientPersister?: ClientPersister\n /** Called once `clientPersister`'s returned promise resolves and the cache has finished restoring. */\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n /** Options for the `QueryClient` the plugin constructs. Ignored if `queryClient` is also set. */\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */\n queryClient?: QueryClient\n}\n\n/**\n * The options accepted by `VueQueryPlugin`: either a `queryClient` to install, or a `queryClientConfig` for the\n * client the plugin creates, plus the shared options.\n */\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\n/**\n * Installs a `QueryClient` on the Vue app, making it available to every descendant component through\n * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin\n * instead of a wrapping component.\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import { VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const app = createApp(App)\n * app.use(VueQueryPlugin)\n * ```\n * @example\n * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per\n * request, or when the same instance also needs to be used outside of Vue components:\n * ```ts\n * import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const queryClient = new QueryClient()\n * app.use(VueQueryPlugin, { queryClient })\n * ```\n * @example\n * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:\n * ```ts\n * app.use(VueQueryPlugin, {\n * queryClientConfig: {\n * defaultOptions: { queries: { staleTime: 5 * 1000 } },\n * },\n * })\n * ```\n */\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!environmentManager.isServer()) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n if (client.isRestoring) {\n client.isRestoring.value = true\n }\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(\n () => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n options.clientPersisterOnSuccess?.(client)\n },\n () => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n },\n )\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root && options.enableDevtoolsV6Plugin) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n if (options.enableDevtoolsV6Plugin) {\n setupDevtools(app, client)\n }\n }\n }\n },\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAa,iBAAiB,EAC5B,UAAU,KAAU,UAAiC,CAAC,MAAM;CAC1D,MAAM,YAAYA,cAAAA,aAAa,QAAQ,cAAc;CACrD,IAAI;CAEJ,IAAI,iBAAiB,WAAW,QAAQ,aACtC,SAAS,QAAQ;MACZ;EACL,MAAM,eACJ,uBAAuB,UAAU,QAAQ,oBAAoB,KAAA;EAC/D,SAAS,IAAIC,oBAAAA,YAAY,YAAY;CACvC;CAEA,IAAI,CAACC,qBAAAA,mBAAmB,SAAS,GAC/B,OAAO,MAAM;CAGf,IAAI,yBAAyB,CAE7B;CAEA,IAAI,QAAQ,iBAAiB;EAC3B,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;EAE7B,MAAM,CAAC,SAAS,WAAW,QAAQ,gBAAgB,MAAM;EACzD,mBAAmB;EACnB,QAAQ,WACA;;GACJ,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;GAE7B,CAAA,wBAAA,QAAQ,8BAAA,QAAA,0BAAA,KAAA,KAAA,sBAAA,KAAA,SAA2B,MAAM;EAC3C,SACM;GACJ,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;EAE/B,CACF;CACF;CAEA,MAAM,gBAAgB;EACpB,OAAO,QAAQ;EACf,iBAAiB;CACnB;CAEA,IAAI,IAAI,WACN,IAAI,UAAU,OAAO;MAChB;EACL,MAAM,kBAAkB,IAAI;EAC5B,IAAI,UAAU,SAAS,kBAAkB;GACvC,QAAQ;GACR,gBAAgB;EAClB;CACF;CAEA,IAAIC,SAAAA,QACF,IAAI,MAAM,EACR,eAAe;EAEb,IAAI,CAAC,KAAK,WAAW;GACnB,MAAM,eAAe,CAAC;GACtB,OAAO,eAAe,MAAM,aAAa;IACvC,WAAW;IACX,MAAM,MAAM,OAAO,OAAO,cAAc,CAAC;GAC3C,CAAC;EACH;EAEA,KAAK,UAAU,aAAa;EAE5B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,SAAS,KAAK,SAAS,QAAQ,wBACjC,0BAAA,cAAc,MAAM,MAAM;EAAA;CAGhC,EACF,CAAC;MACI;EACL,IAAI,QAAQ,WAAW,MAAM;EAE7B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,QAAQ,wBACV,0BAAA,cAAc,KAAK,MAAM;EAAA;CAG/B;AACF,EACF"}
@@ -53,6 +53,8 @@ const VueQueryPlugin = { install: (app, options = {}) => {
53
53
  var _options$clientPersis;
54
54
  if (client.isRestoring) client.isRestoring.value = false;
55
55
  (_options$clientPersis = options.clientPersisterOnSuccess) === null || _options$clientPersis === void 0 || _options$clientPersis.call(options, client);
56
+ }, () => {
57
+ if (client.isRestoring) client.isRestoring.value = false;
56
58
  });
57
59
  }
58
60
  const cleanup = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"vueQueryPlugin.js","names":["QueryClient"],"sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { environmentManager } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n /** Enables the legacy Vue Devtools v6 plugin panel. Prefer `@tanstack/vue-query-devtools` for Vue 3 apps. */\n enableDevtoolsV6Plugin?: boolean\n /**\n * Distinguishes multiple `QueryClient`s provided in the same app — pass the same key to `useQueryClient` to\n * pick this one. Only needed when installing more than one client.\n */\n queryClientKey?: string\n /**\n * Restores a persisted cache before the app mounts. While it runs, `queryClient.isRestoring` is `true`, which\n * suppresses fetches — see `usePersistQueryClient` in `@tanstack/query-persist-client-core` for building one.\n */\n clientPersister?: ClientPersister\n /** Called once `clientPersister`'s returned promise resolves and the cache has finished restoring. */\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n /** Options for the `QueryClient` the plugin constructs. Ignored if `queryClient` is also set. */\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */\n queryClient?: QueryClient\n}\n\n/**\n * The options accepted by `VueQueryPlugin`: either a `queryClient` to install, or a `queryClientConfig` for the\n * client the plugin creates, plus the shared options.\n */\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\n/**\n * Installs a `QueryClient` on the Vue app, making it available to every descendant component through\n * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin\n * instead of a wrapping component.\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import { VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const app = createApp(App)\n * app.use(VueQueryPlugin)\n * ```\n * @example\n * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per\n * request, or when the same instance also needs to be used outside of Vue components:\n * ```ts\n * import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const queryClient = new QueryClient()\n * app.use(VueQueryPlugin, { queryClient })\n * ```\n * @example\n * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:\n * ```ts\n * app.use(VueQueryPlugin, {\n * queryClientConfig: {\n * defaultOptions: { queries: { staleTime: 5 * 1000 } },\n * },\n * })\n * ```\n */\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!environmentManager.isServer()) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n if (client.isRestoring) {\n client.isRestoring.value = true\n }\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n options.clientPersisterOnSuccess?.(client)\n })\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root && options.enableDevtoolsV6Plugin) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n if (options.enableDevtoolsV6Plugin) {\n setupDevtools(app, client)\n }\n }\n }\n },\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAa,iBAAiB,EAC5B,UAAU,KAAU,UAAiC,CAAC,MAAM;CAC1D,MAAM,YAAY,aAAa,QAAQ,cAAc;CACrD,IAAI;CAEJ,IAAI,iBAAiB,WAAW,QAAQ,aACtC,SAAS,QAAQ;MACZ;EACL,MAAM,eACJ,uBAAuB,UAAU,QAAQ,oBAAoB,KAAA;EAC/D,SAAS,IAAIA,cAAY,YAAY;CACvC;CAEA,IAAI,CAAC,mBAAmB,SAAS,GAC/B,OAAO,MAAM;CAGf,IAAI,yBAAyB,CAE7B;CAEA,IAAI,QAAQ,iBAAiB;EAC3B,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;EAE7B,MAAM,CAAC,SAAS,WAAW,QAAQ,gBAAgB,MAAM;EACzD,mBAAmB;EACnB,QAAQ,WAAW;;GACjB,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;GAE7B,CAAA,wBAAA,QAAQ,8BAAA,QAAA,0BAAA,KAAA,KAAA,sBAAA,KAAA,SAA2B,MAAM;EAC3C,CAAC;CACH;CAEA,MAAM,gBAAgB;EACpB,OAAO,QAAQ;EACf,iBAAiB;CACnB;CAEA,IAAI,IAAI,WACN,IAAI,UAAU,OAAO;MAChB;EACL,MAAM,kBAAkB,IAAI;EAC5B,IAAI,UAAU,SAAS,kBAAkB;GACvC,QAAQ;GACR,gBAAgB;EAClB;CACF;CAEA,IAAI,QACF,IAAI,MAAM,EACR,eAAe;EAEb,IAAI,CAAC,KAAK,WAAW;GACnB,MAAM,eAAe,CAAC;GACtB,OAAO,eAAe,MAAM,aAAa;IACvC,WAAW;IACX,MAAM,MAAM,OAAO,OAAO,cAAc,CAAC;GAC3C,CAAC;EACH;EAEA,KAAK,UAAU,aAAa;EAE5B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,SAAS,KAAK,SAAS,QAAQ,wBACjC,cAAc,MAAM,MAAM;EAAA;CAGhC,EACF,CAAC;MACI;EACL,IAAI,QAAQ,WAAW,MAAM;EAE7B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,QAAQ,wBACV,cAAc,KAAK,MAAM;EAAA;CAG/B;AACF,EACF"}
1
+ {"version":3,"file":"vueQueryPlugin.js","names":["QueryClient"],"sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { environmentManager } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n /** Enables the legacy Vue Devtools v6 plugin panel. Prefer `@tanstack/vue-query-devtools` for Vue 3 apps. */\n enableDevtoolsV6Plugin?: boolean\n /**\n * Distinguishes multiple `QueryClient`s provided in the same app — pass the same key to `useQueryClient` to\n * pick this one. Only needed when installing more than one client.\n */\n queryClientKey?: string\n /**\n * Restores a persisted cache before the app mounts. While it runs, `queryClient.isRestoring` is `true`, which\n * suppresses fetches — see `usePersistQueryClient` in `@tanstack/query-persist-client-core` for building one.\n */\n clientPersister?: ClientPersister\n /** Called once `clientPersister`'s returned promise resolves and the cache has finished restoring. */\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n /** Options for the `QueryClient` the plugin constructs. Ignored if `queryClient` is also set. */\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */\n queryClient?: QueryClient\n}\n\n/**\n * The options accepted by `VueQueryPlugin`: either a `queryClient` to install, or a `queryClientConfig` for the\n * client the plugin creates, plus the shared options.\n */\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\n/**\n * Installs a `QueryClient` on the Vue app, making it available to every descendant component through\n * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin\n * instead of a wrapping component.\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import { VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const app = createApp(App)\n * app.use(VueQueryPlugin)\n * ```\n * @example\n * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per\n * request, or when the same instance also needs to be used outside of Vue components:\n * ```ts\n * import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const queryClient = new QueryClient()\n * app.use(VueQueryPlugin, { queryClient })\n * ```\n * @example\n * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:\n * ```ts\n * app.use(VueQueryPlugin, {\n * queryClientConfig: {\n * defaultOptions: { queries: { staleTime: 5 * 1000 } },\n * },\n * })\n * ```\n */\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!environmentManager.isServer()) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n if (client.isRestoring) {\n client.isRestoring.value = true\n }\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(\n () => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n options.clientPersisterOnSuccess?.(client)\n },\n () => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n },\n )\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root && options.enableDevtoolsV6Plugin) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n if (options.enableDevtoolsV6Plugin) {\n setupDevtools(app, client)\n }\n }\n }\n },\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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hC,EACF,CAAC;MACI;EACL,IAAI,QAAQ,WAAW,MAAM;EAE7B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,QAAQ,wBACV,cAAc,KAAK,MAAM;EAAA;CAG/B;AACF,EACF"}
@@ -4,7 +4,7 @@ import { t as QueryClient } from "./queryClient-BGn8uIej.cjs";
4
4
  import { useQueryClient } from "./useQueryClient.cjs";
5
5
  import { VueQueryPlugin, VueQueryPluginOptions } from "./vueQueryPlugin.cjs";
6
6
  import { QueryCache } from "./queryCache.cjs";
7
- import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, n as UndefinedInitialDataInfiniteOptions, o as useInfiniteQuery, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CkULbee9.cjs";
7
+ import { a as UseInfiniteQueryOptions, i as UseInfiniteQueryDefinedReturnType, n as UndefinedInitialDataInfiniteOptions, o as UseInfiniteQueryReturnType, r as infiniteQueryOptions, s as useInfiniteQuery, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-lJ_zR-As.cjs";
8
8
  import { MutationCache } from "./mutationCache.cjs";
9
9
  import { mutationOptions } from "./mutationOptions.cjs";
10
10
  import { UseQueryDefinedReturnType, UseQueryReturnType, useQuery } from "./useQuery.cjs";
@@ -16,4 +16,4 @@ import { UseIsFetchingFilters, useIsFetching } from "./useIsFetching.cjs";
16
16
  import { MutationStateOptions, UseIsMutatingFilters, useIsMutating, useMutationState } from "./useMutationState.cjs";
17
17
  import { VUE_QUERY_CLIENT } from "./utils.cjs";
18
18
  export * from "@tanstack/query-core";
19
- export { type DefinedInitialDataInfiniteOptions, type DefinedInitialQueryOptions, type DefinedInitialQueryOptionsWithDataTag, MutationCache, type MutationOptions, type MutationResult, type MutationStateOptions, QueryCache, QueryClient, type QueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialQueryOptions, type UndefinedInitialQueryOptionsWithDataTag, type UseInfiniteQueryOptions, type UseInfiniteQueryReturnType, type UseIsFetchingFilters, type UseIsMutatingFilters, type UseMutationOptions, type UseMutationReturnType, type UsePrefetchInfiniteQueryOptions, type UsePrefetchQueryOptions, type UseQueriesOptions, type UseQueriesResults, type UseQueryDefinedReturnType, type UseQueryOptions, type UseQueryReturnType, VUE_QUERY_CLIENT, VueQueryPlugin, type VueQueryPluginOptions, infiniteQueryOptions, mutationOptions, queryOptions, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useMutationState, usePrefetchInfiniteQuery, usePrefetchQuery, useQueries, useQuery, useQueryClient };
19
+ export { type DefinedInitialDataInfiniteOptions, type DefinedInitialQueryOptions, type DefinedInitialQueryOptionsWithDataTag, MutationCache, type MutationOptions, type MutationResult, type MutationStateOptions, QueryCache, QueryClient, type QueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialQueryOptions, type UndefinedInitialQueryOptionsWithDataTag, type UseInfiniteQueryDefinedReturnType, type UseInfiniteQueryOptions, type UseInfiniteQueryReturnType, type UseIsFetchingFilters, type UseIsMutatingFilters, type UseMutationOptions, type UseMutationReturnType, type UsePrefetchInfiniteQueryOptions, type UsePrefetchQueryOptions, type UseQueriesOptions, type UseQueriesResults, type UseQueryDefinedReturnType, type UseQueryOptions, type UseQueryReturnType, VUE_QUERY_CLIENT, VueQueryPlugin, type VueQueryPluginOptions, infiniteQueryOptions, mutationOptions, queryOptions, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useMutationState, usePrefetchInfiniteQuery, usePrefetchQuery, useQueries, useQuery, useQueryClient };
@@ -4,7 +4,7 @@ import { t as QueryClient } from "./queryClient-Ba4HSFnn.js";
4
4
  import { useQueryClient } from "./useQueryClient.js";
5
5
  import { VueQueryPlugin, VueQueryPluginOptions } from "./vueQueryPlugin.js";
6
6
  import { QueryCache } from "./queryCache.js";
7
- import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, n as UndefinedInitialDataInfiniteOptions, o as useInfiniteQuery, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CGWmFi6_.js";
7
+ import { a as UseInfiniteQueryOptions, i as UseInfiniteQueryDefinedReturnType, n as UndefinedInitialDataInfiniteOptions, o as UseInfiniteQueryReturnType, r as infiniteQueryOptions, s as useInfiniteQuery, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CN37iZvc.js";
8
8
  import { MutationCache } from "./mutationCache.js";
9
9
  import { mutationOptions } from "./mutationOptions.js";
10
10
  import { UseQueryDefinedReturnType, UseQueryReturnType, useQuery } from "./useQuery.js";
@@ -16,4 +16,4 @@ import { UseIsFetchingFilters, useIsFetching } from "./useIsFetching.js";
16
16
  import { MutationStateOptions, UseIsMutatingFilters, useIsMutating, useMutationState } from "./useMutationState.js";
17
17
  import { VUE_QUERY_CLIENT } from "./utils.js";
18
18
  export * from "@tanstack/query-core";
19
- export { type DefinedInitialDataInfiniteOptions, type DefinedInitialQueryOptions, type DefinedInitialQueryOptionsWithDataTag, MutationCache, type MutationOptions, type MutationResult, type MutationStateOptions, QueryCache, QueryClient, type QueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialQueryOptions, type UndefinedInitialQueryOptionsWithDataTag, type UseInfiniteQueryOptions, type UseInfiniteQueryReturnType, type UseIsFetchingFilters, type UseIsMutatingFilters, type UseMutationOptions, type UseMutationReturnType, type UsePrefetchInfiniteQueryOptions, type UsePrefetchQueryOptions, type UseQueriesOptions, type UseQueriesResults, type UseQueryDefinedReturnType, type UseQueryOptions, type UseQueryReturnType, VUE_QUERY_CLIENT, VueQueryPlugin, type VueQueryPluginOptions, infiniteQueryOptions, mutationOptions, queryOptions, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useMutationState, usePrefetchInfiniteQuery, usePrefetchQuery, useQueries, useQuery, useQueryClient };
19
+ export { type DefinedInitialDataInfiniteOptions, type DefinedInitialQueryOptions, type DefinedInitialQueryOptionsWithDataTag, MutationCache, type MutationOptions, type MutationResult, type MutationStateOptions, QueryCache, QueryClient, type QueryOptions, type UndefinedInitialDataInfiniteOptions, type UndefinedInitialQueryOptions, type UndefinedInitialQueryOptionsWithDataTag, type UseInfiniteQueryDefinedReturnType, type UseInfiniteQueryOptions, type UseInfiniteQueryReturnType, type UseIsFetchingFilters, type UseIsMutatingFilters, type UseMutationOptions, type UseMutationReturnType, type UsePrefetchInfiniteQueryOptions, type UsePrefetchQueryOptions, type UseQueriesOptions, type UseQueriesResults, type UseQueryDefinedReturnType, type UseQueryOptions, type UseQueryReturnType, VUE_QUERY_CLIENT, VueQueryPlugin, type VueQueryPluginOptions, infiniteQueryOptions, mutationOptions, queryOptions, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useMutationState, usePrefetchInfiniteQuery, usePrefetchQuery, useQueries, useQuery, useQueryClient };
@@ -1,7 +1,7 @@
1
1
  import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-u_Tu5Ybs.js";
2
2
  import { o as UseQueryOptions } from "./queryOptions-dXiBZnGk.js";
3
3
  import { t as QueryClient$1 } from "./queryClient-Ba4HSFnn.js";
4
- import { DefaultError, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
4
+ import { DefaultError, DefinedInfiniteQueryObserverResult, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
5
5
  import { Ref } from "vue-demi";
6
6
  /**
7
7
  * The result of the query composables: every property of the observer result wrapped in a `Ref`, except
@@ -39,6 +39,11 @@ type UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TDat
39
39
  * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.
40
40
  */
41
41
  type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, InfiniteQueryObserverResult<TData, TError>>;
42
+ /**
43
+ * The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined` (unless a `select`
44
+ * changes `TData` to include `undefined`).
45
+ */
46
+ type UseInfiniteQueryDefinedReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, DefinedInfiniteQueryObserverResult<TData, TError>>;
42
47
  /**
43
48
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
44
49
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
@@ -86,7 +91,7 @@ type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, T
86
91
  * </template>
87
92
  * ```
88
93
  */
89
- declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: MaybeRefOrGetter<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseInfiniteQueryReturnType<TData, TError>;
94
+ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: MaybeRefOrGetter<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseInfiniteQueryDefinedReturnType<TData, TError>;
90
95
  /**
91
96
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
92
97
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
@@ -365,5 +370,5 @@ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData
365
370
  * ```
366
371
  */
367
372
  declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>;
368
- export { UseInfiniteQueryReturnType as a, useBaseQuery as c, UseInfiniteQueryOptions as i, UndefinedInitialDataInfiniteOptions as n, useInfiniteQuery as o, infiniteQueryOptions as r, UseBaseQueryReturnType as s, DefinedInitialDataInfiniteOptions as t };
369
- //# sourceMappingURL=infiniteQueryOptions-CGWmFi6_.d.ts.map
373
+ export { UseInfiniteQueryOptions as a, UseBaseQueryReturnType as c, UseInfiniteQueryDefinedReturnType as i, useBaseQuery as l, UndefinedInitialDataInfiniteOptions as n, UseInfiniteQueryReturnType as o, infiniteQueryOptions as r, useInfiniteQuery as s, DefinedInitialDataInfiniteOptions as t };
374
+ //# sourceMappingURL=infiniteQueryOptions-CN37iZvc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infiniteQueryOptions-CN37iZvc.d.ts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;;;;KA8BY,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAIlB,QAAQ,KACR,IAAI,SAAS,SAAS;;;;;;;;;EAU1B,gBAAgB,QAAQ;;KAGrB,uBACH,cACA,QACA,OACA,YACA,kBAAkB,WAAW,UAC7B,wBAEE,gBAAgB,cAAc,QAAQ,OAAO,YAAY,aACzD,wBAAwB,cAAc,QAAQ,OAAO,WAAW;;;;;;;;;iBAUpD,aACd,cACA,QACA,OACA,YACA,kBAAkB,UAClB,YAEA,iBAAiB,eACjB,SAAS,iBACP,uBACE,cACA,QACA,OACA,YACA,WACA,cAGJ,cAAcA,gBACb,uBAAuB,OAAO;;;;;;KC5DrB,wBACV,wBACA,SAAS,cACT,QAAQ,cACR,kBAAkB,WAAW,UAC7B,wBACE,YAGE,kBAAkB,6BAChB,cACA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,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;;;;;;;;EASA,aACI,kBAAkB,aAAa,cAAc,sBACtC,kBAAkB,aAAa,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiC1C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,kCACP,cACA,QACA,OACA,WACA,cAED,kCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;iBA0B7C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,oCACP,cACA,QACA,OACA,WACA,cAED,oCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe"}
@@ -1,7 +1,7 @@
1
1
  import { a as MaybeRef, d as ShallowOption, o as MaybeRefDeep, s as MaybeRefOrGetter, t as DeepUnwrapRef } from "./types-u_Tu5Ybs.cjs";
2
2
  import { o as UseQueryOptions } from "./queryOptions-BuZEBLtg.cjs";
3
3
  import { t as QueryClient$1 } from "./queryClient-BGn8uIej.cjs";
4
- import { DefaultError, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
4
+ import { DefaultError, DefinedInfiniteQueryObserverResult, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, InitialDataFunction, NonUndefinedGuard, QueryKey, QueryKeyWithDataTag, QueryObserver, QueryObserverResult } from "@tanstack/query-core";
5
5
  import { Ref } from "vue-demi";
6
6
  /**
7
7
  * The result of the query composables: every property of the observer result wrapped in a `Ref`, except
@@ -39,6 +39,11 @@ type UseInfiniteQueryOptions<TQueryFnData = unknown, TError = DefaultError, TDat
39
39
  * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.
40
40
  */
41
41
  type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, InfiniteQueryObserverResult<TData, TError>>;
42
+ /**
43
+ * The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined` (unless a `select`
44
+ * changes `TData` to include `undefined`).
45
+ */
46
+ type UseInfiniteQueryDefinedReturnType<TData, TError> = UseBaseQueryReturnType<TData, TError, DefinedInfiniteQueryObserverResult<TData, TError>>;
42
47
  /**
43
48
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
44
49
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
@@ -86,7 +91,7 @@ type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<TData, T
86
91
  * </template>
87
92
  * ```
88
93
  */
89
- declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: MaybeRefOrGetter<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseInfiniteQueryReturnType<TData, TError>;
94
+ declare function useInfiniteQuery<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: MaybeRefOrGetter<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>>, queryClient?: QueryClient$1): UseInfiniteQueryDefinedReturnType<TData, TError>;
90
95
  /**
91
96
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
92
97
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
@@ -365,5 +370,5 @@ declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData
365
370
  * ```
366
371
  */
367
372
  declare function infiniteQueryOptions<TQueryFnData, TError = DefaultError, TData = InfiniteData<TQueryFnData>, TQueryKey extends QueryKey = QueryKey, TPageParam = unknown>(options: UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>): UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam> & QueryKeyWithDataTag<TQueryKey, InfiniteData<TQueryFnData>, TError>;
368
- export { UseInfiniteQueryReturnType as a, useBaseQuery as c, UseInfiniteQueryOptions as i, UndefinedInitialDataInfiniteOptions as n, useInfiniteQuery as o, infiniteQueryOptions as r, UseBaseQueryReturnType as s, DefinedInitialDataInfiniteOptions as t };
369
- //# sourceMappingURL=infiniteQueryOptions-CkULbee9.d.cts.map
373
+ export { UseInfiniteQueryOptions as a, UseBaseQueryReturnType as c, UseInfiniteQueryDefinedReturnType as i, useBaseQuery as l, UndefinedInitialDataInfiniteOptions as n, UseInfiniteQueryReturnType as o, infiniteQueryOptions as r, useInfiniteQuery as s, DefinedInitialDataInfiniteOptions as t };
374
+ //# sourceMappingURL=infiniteQueryOptions-lJ_zR-As.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infiniteQueryOptions-lJ_zR-As.d.cts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;;;;KA8BY,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAIlB,QAAQ,KACR,IAAI,SAAS,SAAS;;;;;;;;;EAU1B,gBAAgB,QAAQ;;KAGrB,uBACH,cACA,QACA,OACA,YACA,kBAAkB,WAAW,UAC7B,wBAEE,gBAAgB,cAAc,QAAQ,OAAO,YAAY,aACzD,wBAAwB,cAAc,QAAQ,OAAO,WAAW;;;;;;;;;iBAUpD,aACd,cACA,QACA,OACA,YACA,kBAAkB,UAClB,YAEA,iBAAiB,eACjB,SAAS,iBACP,uBACE,cACA,QACA,OACA,YACA,WACA,cAGJ,cAAcA,gBACb,uBAAuB,OAAO;;;;;;KC5DrB,wBACV,wBACA,SAAS,cACT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,cAAc;;;;;;;;;;;;KAczC,kCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;;;;;;;;EASA,aACI,kBAAkB,aAAa,cAAc,sBACtC,kBAAkB,aAAa,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiC1C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,kCACP,cACA,QACA,OACA,WACA,cAED,kCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;iBA0B7C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,oCACP,cACA,QACA,OACA,WACA,cAED,oCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe"}
@@ -1,2 +1,2 @@
1
- import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CkULbee9.cjs";
1
+ import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-lJ_zR-As.cjs";
2
2
  export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, infiniteQueryOptions };
@@ -1,2 +1,2 @@
1
- import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CGWmFi6_.js";
1
+ import { n as UndefinedInitialDataInfiniteOptions, r as infiniteQueryOptions, t as DefinedInitialDataInfiniteOptions } from "./infiniteQueryOptions-CN37iZvc.js";
2
2
  export { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, infiniteQueryOptions };
@@ -1,2 +1,2 @@
1
- import { c as useBaseQuery, s as UseBaseQueryReturnType } from "./infiniteQueryOptions-CkULbee9.cjs";
1
+ import { c as UseBaseQueryReturnType, l as useBaseQuery } from "./infiniteQueryOptions-lJ_zR-As.cjs";
2
2
  export { UseBaseQueryReturnType, useBaseQuery };
@@ -1,2 +1,2 @@
1
- import { c as useBaseQuery, s as UseBaseQueryReturnType } from "./infiniteQueryOptions-CGWmFi6_.js";
1
+ import { c as UseBaseQueryReturnType, l as useBaseQuery } from "./infiniteQueryOptions-CN37iZvc.js";
2
2
  export { UseBaseQueryReturnType, useBaseQuery };
@@ -1 +1 @@
1
- {"version":3,"file":"useInfiniteQuery.cjs","names":["useBaseQuery","InfiniteQueryObserver"],"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\n\nimport type { UseBaseQueryReturnType } from './useBaseQuery'\n\nimport type {\n DeepUnwrapRef,\n MaybeRef,\n MaybeRefDeep,\n MaybeRefOrGetter,\n ShallowOption,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\n/**\n * The options accepted by `useInfiniteQuery`. Same as {@link InfiniteQueryObserverOptions} from\n * `@tanstack/query-core`, plus the `shallow` option. Each option except `shallow` can also be a `ref` (and\n * `enabled` a reactive getter).\n */\nexport type UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = MaybeRef<\n {\n [\n Property in keyof InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n ]: Property extends 'enabled'\n ? MaybeRefOrGetter<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n : MaybeRefDeep<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n } & ShallowOption\n>\n\n/**\n * The result of `useInfiniteQuery`: {@link InfiniteQueryObserverResult} from `@tanstack/query-core`, with\n * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.\n */\nexport type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<\n TData,\n TError,\n InfiniteQueryObserverResult<TData, TError>\n>\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, so the resulting `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` known to be defined.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * Fetching the next page from a \"Load More\" button click:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <button @click=\"fetchNextPage()\" :disabled=\"!hasNextPage || isFetching\">\n * {{ isFetchingNextPage ? 'Loading more...' : hasNextPage ? 'Load More' : 'Nothing more to load' }}\n * </button>\n * </template>\n * </template>\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 * ```vue\n * <script setup lang=\"ts\">\n * import { onUnmounted, ref, watch } from 'vue'\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 sentinel = ref<HTMLElement>()\n * let observer: IntersectionObserver | undefined\n *\n * watch(sentinel, (el) => {\n * observer?.disconnect()\n * if (el == null) return\n *\n * observer = new IntersectionObserver(([entry]) => {\n * if (entry?.isIntersecting && hasNextPage.value && !isFetching.value) {\n * fetchNextPage()\n * }\n * })\n * observer.observe(el)\n * })\n *\n * onUnmounted(() => observer?.disconnect())\n * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <div ref=\"sentinel\">{{ isFetchingNextPage ? 'Loading more...' : '' }}</div>\n * </template>\n * </template>\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: MaybeRefOrGetter<\n UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\n/**\n * Fallback overload for options whose `initialData` presence isn't statically known — for example, a\n * `ref`/reactive object built up conditionally, rather than a plain object literal. Prefer one of the other\n * overloads when possible, since they infer whether `data` can be `undefined` from `initialData` directly.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - A `ref`, plain value, or reactive getter resolving to the {@link UseInfiniteQueryOptions} to\n * use.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`.\n * @example\n * Passing a whole-options getter so `maxPages` reacts to a setting stored elsewhere, not just `queryKey`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ projectId: number; maxPages: number }>()\n *\n * const { data } = useInfiniteQuery(() => ({\n * queryKey: ['project', props.projectId, 'issues'],\n * queryFn: ({ pageParam }) => fetchIssues(props.projectId, pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * maxPages: props.maxPages,\n * }))\n * </script>\n *\n * <template>\n * <template v-for=\"page in data?.pages\" :key=\"page.nextId\">\n * <li v-for=\"issue in page.issues\" :key=\"issue.id\">{{ issue.title }}</li>\n * </template>\n * </template>\n * ```\n * @example\n * A query that's disabled, type-safe, until `postId` is set — pass `skipToken` as `queryFn` instead of\n * setting `enabled: false`. This requires a whole-options getter: `queryFn` isn't itself reactive, so the\n * getter is what re-evaluates it on every change to `props.postId`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { skipToken, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: string | undefined }>()\n *\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 * const postId = props.postId\n * return {\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 * </script>\n *\n * <template>\n * <span v-if=\"props.postId == null\">Select a post</span>\n * <span v-else-if=\"isLoading\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <ul v-else>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"comment in page.comments\" :key=\"comment.id\">{{ comment.text }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\nexport function useInfiniteQuery(\n options: MaybeRefOrGetter<UseInfiniteQueryOptions>,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n InfiniteQueryObserver as typeof QueryObserver,\n options,\n queryClient,\n )\n}\n"],"mappings":";;;;AA2WA,SAAgB,iBACd,SACA,aACA;CACA,OAAOA,qBAAAA,aACLC,qBAAAA,uBACA,SACA,WACF;AACF"}
1
+ {"version":3,"file":"useInfiniteQuery.cjs","names":["useBaseQuery","InfiniteQueryObserver"],"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\nimport type {\n DefaultError,\n DefinedInfiniteQueryObserverResult,\n InfiniteData,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\n\nimport type { UseBaseQueryReturnType } from './useBaseQuery'\n\nimport type {\n DeepUnwrapRef,\n MaybeRef,\n MaybeRefDeep,\n MaybeRefOrGetter,\n ShallowOption,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\n/**\n * The options accepted by `useInfiniteQuery`. Same as {@link InfiniteQueryObserverOptions} from\n * `@tanstack/query-core`, plus the `shallow` option. Each option except `shallow` can also be a `ref` (and\n * `enabled` a reactive getter).\n */\nexport type UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = MaybeRef<\n {\n [\n Property in keyof InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n ]: Property extends 'enabled'\n ? MaybeRefOrGetter<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n : MaybeRefDeep<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n } & ShallowOption\n>\n\n/**\n * The result of `useInfiniteQuery`: {@link InfiniteQueryObserverResult} from `@tanstack/query-core`, with\n * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.\n */\nexport type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<\n TData,\n TError,\n InfiniteQueryObserverResult<TData, TError>\n>\n\n/**\n * The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined` (unless a `select`\n * changes `TData` to include `undefined`).\n */\nexport type UseInfiniteQueryDefinedReturnType<TData, TError> =\n UseBaseQueryReturnType<\n TData,\n TError,\n DefinedInfiniteQueryObserverResult<TData, TError>\n >\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, so the resulting `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` known to be defined.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryDefinedReturnType<TData, TError>\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * Fetching the next page from a \"Load More\" button click:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <button @click=\"fetchNextPage()\" :disabled=\"!hasNextPage || isFetching\">\n * {{ isFetchingNextPage ? 'Loading more...' : hasNextPage ? 'Load More' : 'Nothing more to load' }}\n * </button>\n * </template>\n * </template>\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 * ```vue\n * <script setup lang=\"ts\">\n * import { onUnmounted, ref, watch } from 'vue'\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 sentinel = ref<HTMLElement>()\n * let observer: IntersectionObserver | undefined\n *\n * watch(sentinel, (el) => {\n * observer?.disconnect()\n * if (el == null) return\n *\n * observer = new IntersectionObserver(([entry]) => {\n * if (entry?.isIntersecting && hasNextPage.value && !isFetching.value) {\n * fetchNextPage()\n * }\n * })\n * observer.observe(el)\n * })\n *\n * onUnmounted(() => observer?.disconnect())\n * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <div ref=\"sentinel\">{{ isFetchingNextPage ? 'Loading more...' : '' }}</div>\n * </template>\n * </template>\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: MaybeRefOrGetter<\n UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\n/**\n * Fallback overload for options whose `initialData` presence isn't statically known — for example, a\n * `ref`/reactive object built up conditionally, rather than a plain object literal. Prefer one of the other\n * overloads when possible, since they infer whether `data` can be `undefined` from `initialData` directly.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - A `ref`, plain value, or reactive getter resolving to the {@link UseInfiniteQueryOptions} to\n * use.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`.\n * @example\n * Passing a whole-options getter so `maxPages` reacts to a setting stored elsewhere, not just `queryKey`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ projectId: number; maxPages: number }>()\n *\n * const { data } = useInfiniteQuery(() => ({\n * queryKey: ['project', props.projectId, 'issues'],\n * queryFn: ({ pageParam }) => fetchIssues(props.projectId, pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * maxPages: props.maxPages,\n * }))\n * </script>\n *\n * <template>\n * <template v-for=\"page in data?.pages\" :key=\"page.nextId\">\n * <li v-for=\"issue in page.issues\" :key=\"issue.id\">{{ issue.title }}</li>\n * </template>\n * </template>\n * ```\n * @example\n * A query that's disabled, type-safe, until `postId` is set — pass `skipToken` as `queryFn` instead of\n * setting `enabled: false`. This requires a whole-options getter: `queryFn` isn't itself reactive, so the\n * getter is what re-evaluates it on every change to `props.postId`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { skipToken, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: string | undefined }>()\n *\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 * const postId = props.postId\n * return {\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 * </script>\n *\n * <template>\n * <span v-if=\"props.postId == null\">Select a post</span>\n * <span v-else-if=\"isLoading\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <ul v-else>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"comment in page.comments\" :key=\"comment.id\">{{ comment.text }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\nexport function useInfiniteQuery(\n options: MaybeRefOrGetter<UseInfiniteQueryOptions>,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n InfiniteQueryObserver as typeof QueryObserver,\n options,\n queryClient,\n )\n}\n"],"mappings":";;;;AAuXA,SAAgB,iBACd,SACA,aACA;CACA,OAAOA,qBAAAA,aACLC,qBAAAA,uBACA,SACA,WACF;AACF"}
@@ -1,2 +1,2 @@
1
- import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, o as useInfiniteQuery } from "./infiniteQueryOptions-CkULbee9.cjs";
2
- export { UseInfiniteQueryOptions, UseInfiniteQueryReturnType, useInfiniteQuery };
1
+ import { a as UseInfiniteQueryOptions, i as UseInfiniteQueryDefinedReturnType, o as UseInfiniteQueryReturnType, s as useInfiniteQuery } from "./infiniteQueryOptions-lJ_zR-As.cjs";
2
+ export { UseInfiniteQueryDefinedReturnType, UseInfiniteQueryOptions, UseInfiniteQueryReturnType, useInfiniteQuery };
@@ -1,2 +1,2 @@
1
- import { a as UseInfiniteQueryReturnType, i as UseInfiniteQueryOptions, o as useInfiniteQuery } from "./infiniteQueryOptions-CGWmFi6_.js";
2
- export { UseInfiniteQueryOptions, UseInfiniteQueryReturnType, useInfiniteQuery };
1
+ import { a as UseInfiniteQueryOptions, i as UseInfiniteQueryDefinedReturnType, o as UseInfiniteQueryReturnType, s as useInfiniteQuery } from "./infiniteQueryOptions-CN37iZvc.js";
2
+ export { UseInfiniteQueryDefinedReturnType, UseInfiniteQueryOptions, UseInfiniteQueryReturnType, useInfiniteQuery };
@@ -1 +1 @@
1
- {"version":3,"file":"useInfiniteQuery.js","names":[],"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\n\nimport type { UseBaseQueryReturnType } from './useBaseQuery'\n\nimport type {\n DeepUnwrapRef,\n MaybeRef,\n MaybeRefDeep,\n MaybeRefOrGetter,\n ShallowOption,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\n/**\n * The options accepted by `useInfiniteQuery`. Same as {@link InfiniteQueryObserverOptions} from\n * `@tanstack/query-core`, plus the `shallow` option. Each option except `shallow` can also be a `ref` (and\n * `enabled` a reactive getter).\n */\nexport type UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = MaybeRef<\n {\n [\n Property in keyof InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n ]: Property extends 'enabled'\n ? MaybeRefOrGetter<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n : MaybeRefDeep<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n } & ShallowOption\n>\n\n/**\n * The result of `useInfiniteQuery`: {@link InfiniteQueryObserverResult} from `@tanstack/query-core`, with\n * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.\n */\nexport type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<\n TData,\n TError,\n InfiniteQueryObserverResult<TData, TError>\n>\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, so the resulting `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` known to be defined.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * Fetching the next page from a \"Load More\" button click:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <button @click=\"fetchNextPage()\" :disabled=\"!hasNextPage || isFetching\">\n * {{ isFetchingNextPage ? 'Loading more...' : hasNextPage ? 'Load More' : 'Nothing more to load' }}\n * </button>\n * </template>\n * </template>\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 * ```vue\n * <script setup lang=\"ts\">\n * import { onUnmounted, ref, watch } from 'vue'\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 sentinel = ref<HTMLElement>()\n * let observer: IntersectionObserver | undefined\n *\n * watch(sentinel, (el) => {\n * observer?.disconnect()\n * if (el == null) return\n *\n * observer = new IntersectionObserver(([entry]) => {\n * if (entry?.isIntersecting && hasNextPage.value && !isFetching.value) {\n * fetchNextPage()\n * }\n * })\n * observer.observe(el)\n * })\n *\n * onUnmounted(() => observer?.disconnect())\n * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <div ref=\"sentinel\">{{ isFetchingNextPage ? 'Loading more...' : '' }}</div>\n * </template>\n * </template>\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: MaybeRefOrGetter<\n UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\n/**\n * Fallback overload for options whose `initialData` presence isn't statically known — for example, a\n * `ref`/reactive object built up conditionally, rather than a plain object literal. Prefer one of the other\n * overloads when possible, since they infer whether `data` can be `undefined` from `initialData` directly.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - A `ref`, plain value, or reactive getter resolving to the {@link UseInfiniteQueryOptions} to\n * use.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`.\n * @example\n * Passing a whole-options getter so `maxPages` reacts to a setting stored elsewhere, not just `queryKey`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ projectId: number; maxPages: number }>()\n *\n * const { data } = useInfiniteQuery(() => ({\n * queryKey: ['project', props.projectId, 'issues'],\n * queryFn: ({ pageParam }) => fetchIssues(props.projectId, pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * maxPages: props.maxPages,\n * }))\n * </script>\n *\n * <template>\n * <template v-for=\"page in data?.pages\" :key=\"page.nextId\">\n * <li v-for=\"issue in page.issues\" :key=\"issue.id\">{{ issue.title }}</li>\n * </template>\n * </template>\n * ```\n * @example\n * A query that's disabled, type-safe, until `postId` is set — pass `skipToken` as `queryFn` instead of\n * setting `enabled: false`. This requires a whole-options getter: `queryFn` isn't itself reactive, so the\n * getter is what re-evaluates it on every change to `props.postId`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { skipToken, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: string | undefined }>()\n *\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 * const postId = props.postId\n * return {\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 * </script>\n *\n * <template>\n * <span v-if=\"props.postId == null\">Select a post</span>\n * <span v-else-if=\"isLoading\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <ul v-else>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"comment in page.comments\" :key=\"comment.id\">{{ comment.text }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\nexport function useInfiniteQuery(\n options: MaybeRefOrGetter<UseInfiniteQueryOptions>,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n InfiniteQueryObserver as typeof QueryObserver,\n options,\n queryClient,\n )\n}\n"],"mappings":";;;AA2WA,SAAgB,iBACd,SACA,aACA;CACA,OAAO,aACL,uBACA,SACA,WACF;AACF"}
1
+ {"version":3,"file":"useInfiniteQuery.js","names":[],"sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["import { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\nimport type {\n DefaultError,\n DefinedInfiniteQueryObserverResult,\n InfiniteData,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\n\nimport type { UseBaseQueryReturnType } from './useBaseQuery'\n\nimport type {\n DeepUnwrapRef,\n MaybeRef,\n MaybeRefDeep,\n MaybeRefOrGetter,\n ShallowOption,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\n/**\n * The options accepted by `useInfiniteQuery`. Same as {@link InfiniteQueryObserverOptions} from\n * `@tanstack/query-core`, plus the `shallow` option. Each option except `shallow` can also be a `ref` (and\n * `enabled` a reactive getter).\n */\nexport type UseInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = MaybeRef<\n {\n [\n Property in keyof InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n ]: Property extends 'enabled'\n ? MaybeRefOrGetter<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n : MaybeRefDeep<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n DeepUnwrapRef<TQueryKey>,\n TPageParam\n >[Property]\n >\n } & ShallowOption\n>\n\n/**\n * The result of `useInfiniteQuery`: {@link InfiniteQueryObserverResult} from `@tanstack/query-core`, with\n * its properties wrapped in `Ref`s as in {@link UseBaseQueryReturnType}.\n */\nexport type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<\n TData,\n TError,\n InfiniteQueryObserverResult<TData, TError>\n>\n\n/**\n * The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined` (unless a `select`\n * changes `TData` to include `undefined`).\n */\nexport type UseInfiniteQueryDefinedReturnType<TData, TError> =\n UseBaseQueryReturnType<\n TData,\n TError,\n DefinedInfiniteQueryObserverResult<TData, TError>\n >\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, so the resulting `data` is never\n * `undefined` (unless a `select` changes `TData` to include `undefined`).\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link DefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`, with `initialData` known to be defined.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isError\">Error: {{ error.message }}</span>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryDefinedReturnType<TData, TError>\n\n/**\n * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of\n * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - The {@link UndefinedInitialDataInfiniteOptions} to use — everything you can pass to\n * `useInfiniteQuery`.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`. `data.value.pages` and\n * `data.value.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 * @example\n * Fetching the next page from a \"Load More\" button click:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <button @click=\"fetchNextPage()\" :disabled=\"!hasNextPage || isFetching\">\n * {{ isFetchingNextPage ? 'Loading more...' : hasNextPage ? 'Load More' : 'Nothing more to load' }}\n * </button>\n * </template>\n * </template>\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 * ```vue\n * <script setup lang=\"ts\">\n * import { onUnmounted, ref, watch } from 'vue'\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\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 sentinel = ref<HTMLElement>()\n * let observer: IntersectionObserver | undefined\n *\n * watch(sentinel, (el) => {\n * observer?.disconnect()\n * if (el == null) return\n *\n * observer = new IntersectionObserver(([entry]) => {\n * if (entry?.isIntersecting && hasNextPage.value && !isFetching.value) {\n * fetchNextPage()\n * }\n * })\n * observer.observe(el)\n * })\n *\n * onUnmounted(() => observer?.disconnect())\n * </script>\n *\n * <template>\n * <span v-if=\"isPending\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <template v-else>\n * <ul>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"project in page.projects\" :key=\"project.id\">{{ project.name }}</li>\n * </template>\n * </ul>\n * <div ref=\"sentinel\">{{ isFetchingNextPage ? 'Loading more...' : '' }}</div>\n * </template>\n * </template>\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: MaybeRefOrGetter<\n UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\n/**\n * Fallback overload for options whose `initialData` presence isn't statically known — for example, a\n * `ref`/reactive object built up conditionally, rather than a plain object literal. Prefer one of the other\n * overloads when possible, since they infer whether `data` can be `undefined` from `initialData` directly.\n *\n * `enabled` tracks reactive dependencies automatically as a `ref`, a plain value, or a reactive getter\n * (`() => ...`). `queryKey` reacts through a `ref` for the array itself, or `ref`s and reactive getters as\n * individual entries — the array itself can't be a bare getter.\n * @param options - A `ref`, plain value, or reactive getter resolving to the {@link UseInfiniteQueryOptions} to\n * use.\n * @param queryClient - Use this to use a custom `QueryClient`. Otherwise, the one provided by `VueQueryPlugin`\n * will be used.\n * @returns The same properties as `useQuery`, with the addition of `fetchNextPage`, `fetchPreviousPage`,\n * `hasNextPage`, `hasPreviousPage`, `isFetchingNextPage`, and `isFetchingPreviousPage`.\n * @example\n * Passing a whole-options getter so `maxPages` reacts to a setting stored elsewhere, not just `queryKey`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ projectId: number; maxPages: number }>()\n *\n * const { data } = useInfiniteQuery(() => ({\n * queryKey: ['project', props.projectId, 'issues'],\n * queryFn: ({ pageParam }) => fetchIssues(props.projectId, pageParam),\n * initialPageParam: 0,\n * getNextPageParam: (lastPage) => lastPage.nextId,\n * maxPages: props.maxPages,\n * }))\n * </script>\n *\n * <template>\n * <template v-for=\"page in data?.pages\" :key=\"page.nextId\">\n * <li v-for=\"issue in page.issues\" :key=\"issue.id\">{{ issue.title }}</li>\n * </template>\n * </template>\n * ```\n * @example\n * A query that's disabled, type-safe, until `postId` is set — pass `skipToken` as `queryFn` instead of\n * setting `enabled: false`. This requires a whole-options getter: `queryFn` isn't itself reactive, so the\n * getter is what re-evaluates it on every change to `props.postId`:\n * ```vue\n * <script setup lang=\"ts\">\n * import { skipToken, useInfiniteQuery } from '@tanstack/vue-query'\n *\n * const props = defineProps<{ postId: string | undefined }>()\n *\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 * const postId = props.postId\n * return {\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 * </script>\n *\n * <template>\n * <span v-if=\"props.postId == null\">Select a post</span>\n * <span v-else-if=\"isLoading\">Loading...</span>\n * <span v-else-if=\"isError\">Error: {{ error.message }}</span>\n * <ul v-else>\n * <template v-for=\"page in data.pages\" :key=\"page.nextId\">\n * <li v-for=\"comment in page.comments\" :key=\"comment.id\">{{ comment.text }}</li>\n * </template>\n * </ul>\n * </template>\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: MaybeRefOrGetter<\n UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryReturnType<TData, TError>\n\nexport function useInfiniteQuery(\n options: MaybeRefOrGetter<UseInfiniteQueryOptions>,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n InfiniteQueryObserver as typeof QueryObserver,\n options,\n queryClient,\n )\n}\n"],"mappings":";;;AAuXA,SAAgB,iBACd,SACA,aACA;CACA,OAAO,aACL,uBACA,SACA,WACF;AACF"}
@@ -1,7 +1,7 @@
1
1
  import { s as MaybeRefOrGetter } from "./types-u_Tu5Ybs.cjs";
2
2
  import { i as UndefinedInitialQueryOptions, o as UseQueryOptions, t as DefinedInitialQueryOptions } from "./queryOptions-BuZEBLtg.cjs";
3
3
  import { t as QueryClient$1 } from "./queryClient-BGn8uIej.cjs";
4
- import { s as UseBaseQueryReturnType } from "./infiniteQueryOptions-CkULbee9.cjs";
4
+ import { c as UseBaseQueryReturnType } from "./infiniteQueryOptions-lJ_zR-As.cjs";
5
5
  import { DefaultError, DefinedQueryObserverResult, QueryKey } from "@tanstack/query-core";
6
6
  /**
7
7
  * The result of `useQuery` when `initialData` is omitted, may be `undefined`, or is a function that may
@@ -1,7 +1,7 @@
1
1
  import { s as MaybeRefOrGetter } from "./types-u_Tu5Ybs.js";
2
2
  import { i as UndefinedInitialQueryOptions, o as UseQueryOptions, t as DefinedInitialQueryOptions } from "./queryOptions-dXiBZnGk.js";
3
3
  import { t as QueryClient$1 } from "./queryClient-Ba4HSFnn.js";
4
- import { s as UseBaseQueryReturnType } from "./infiniteQueryOptions-CGWmFi6_.js";
4
+ import { c as UseBaseQueryReturnType } from "./infiniteQueryOptions-CN37iZvc.js";
5
5
  import { DefaultError, DefinedQueryObserverResult, QueryKey } from "@tanstack/query-core";
6
6
  /**
7
7
  * The result of `useQuery` when `initialData` is omitted, may be `undefined`, or is a function that may
@@ -53,6 +53,8 @@ const VueQueryPlugin = { install: (app, options = {}) => {
53
53
  promise.then(() => {
54
54
  if (client.isRestoring) client.isRestoring.value = false;
55
55
  options.clientPersisterOnSuccess?.(client);
56
+ }, () => {
57
+ if (client.isRestoring) client.isRestoring.value = false;
56
58
  });
57
59
  }
58
60
  const cleanup = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"vueQueryPlugin.cjs","names":["getClientKey","QueryClient","environmentManager","isVue2"],"sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { environmentManager } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n /** Enables the legacy Vue Devtools v6 plugin panel. Prefer `@tanstack/vue-query-devtools` for Vue 3 apps. */\n enableDevtoolsV6Plugin?: boolean\n /**\n * Distinguishes multiple `QueryClient`s provided in the same app — pass the same key to `useQueryClient` to\n * pick this one. Only needed when installing more than one client.\n */\n queryClientKey?: string\n /**\n * Restores a persisted cache before the app mounts. While it runs, `queryClient.isRestoring` is `true`, which\n * suppresses fetches — see `usePersistQueryClient` in `@tanstack/query-persist-client-core` for building one.\n */\n clientPersister?: ClientPersister\n /** Called once `clientPersister`'s returned promise resolves and the cache has finished restoring. */\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n /** Options for the `QueryClient` the plugin constructs. Ignored if `queryClient` is also set. */\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */\n queryClient?: QueryClient\n}\n\n/**\n * The options accepted by `VueQueryPlugin`: either a `queryClient` to install, or a `queryClientConfig` for the\n * client the plugin creates, plus the shared options.\n */\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\n/**\n * Installs a `QueryClient` on the Vue app, making it available to every descendant component through\n * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin\n * instead of a wrapping component.\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import { VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const app = createApp(App)\n * app.use(VueQueryPlugin)\n * ```\n * @example\n * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per\n * request, or when the same instance also needs to be used outside of Vue components:\n * ```ts\n * import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const queryClient = new QueryClient()\n * app.use(VueQueryPlugin, { queryClient })\n * ```\n * @example\n * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:\n * ```ts\n * app.use(VueQueryPlugin, {\n * queryClientConfig: {\n * defaultOptions: { queries: { staleTime: 5 * 1000 } },\n * },\n * })\n * ```\n */\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!environmentManager.isServer()) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n if (client.isRestoring) {\n client.isRestoring.value = true\n }\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n options.clientPersisterOnSuccess?.(client)\n })\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root && options.enableDevtoolsV6Plugin) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n if (options.enableDevtoolsV6Plugin) {\n setupDevtools(app, client)\n }\n }\n }\n },\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAa,iBAAiB,EAC5B,UAAU,KAAU,UAAiC,CAAC,MAAM;CAC1D,MAAM,YAAYA,cAAAA,aAAa,QAAQ,cAAc;CACrD,IAAI;CAEJ,IAAI,iBAAiB,WAAW,QAAQ,aACtC,SAAS,QAAQ;MACZ;EACL,MAAM,eACJ,uBAAuB,UAAU,QAAQ,oBAAoB,KAAA;EAC/D,SAAS,IAAIC,oBAAAA,YAAY,YAAY;CACvC;CAEA,IAAI,CAACC,qBAAAA,mBAAmB,SAAS,GAC/B,OAAO,MAAM;CAGf,IAAI,yBAAyB,CAE7B;CAEA,IAAI,QAAQ,iBAAiB;EAC3B,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;EAE7B,MAAM,CAAC,SAAS,WAAW,QAAQ,gBAAgB,MAAM;EACzD,mBAAmB;EACnB,QAAQ,WAAW;GACjB,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;GAE7B,QAAQ,2BAA2B,MAAM;EAC3C,CAAC;CACH;CAEA,MAAM,gBAAgB;EACpB,OAAO,QAAQ;EACf,iBAAiB;CACnB;CAEA,IAAI,IAAI,WACN,IAAI,UAAU,OAAO;MAChB;EACL,MAAM,kBAAkB,IAAI;EAC5B,IAAI,UAAU,SAAS,kBAAkB;GACvC,QAAQ;GACR,gBAAgB;EAClB;CACF;CAEA,IAAIC,SAAAA,QACF,IAAI,MAAM,EACR,eAAe;EAEb,IAAI,CAAC,KAAK,WAAW;GACnB,MAAM,eAAe,CAAC;GACtB,OAAO,eAAe,MAAM,aAAa;IACvC,WAAW;IACX,MAAM,MAAM,OAAO,OAAO,cAAc,CAAC;GAC3C,CAAC;EACH;EAEA,KAAK,UAAU,aAAa;EAE5B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,SAAS,KAAK,SAAS,QAAQ,wBACjC,0BAAA,cAAc,MAAM,MAAM;EAAA;CAGhC,EACF,CAAC;MACI;EACL,IAAI,QAAQ,WAAW,MAAM;EAE7B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,QAAQ,wBACV,0BAAA,cAAc,KAAK,MAAM;EAAA;CAG/B;AACF,EACF"}
1
+ {"version":3,"file":"vueQueryPlugin.cjs","names":["getClientKey","QueryClient","environmentManager","isVue2"],"sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { environmentManager } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n /** Enables the legacy Vue Devtools v6 plugin panel. Prefer `@tanstack/vue-query-devtools` for Vue 3 apps. */\n enableDevtoolsV6Plugin?: boolean\n /**\n * Distinguishes multiple `QueryClient`s provided in the same app — pass the same key to `useQueryClient` to\n * pick this one. Only needed when installing more than one client.\n */\n queryClientKey?: string\n /**\n * Restores a persisted cache before the app mounts. While it runs, `queryClient.isRestoring` is `true`, which\n * suppresses fetches — see `usePersistQueryClient` in `@tanstack/query-persist-client-core` for building one.\n */\n clientPersister?: ClientPersister\n /** Called once `clientPersister`'s returned promise resolves and the cache has finished restoring. */\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n /** Options for the `QueryClient` the plugin constructs. Ignored if `queryClient` is also set. */\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */\n queryClient?: QueryClient\n}\n\n/**\n * The options accepted by `VueQueryPlugin`: either a `queryClient` to install, or a `queryClientConfig` for the\n * client the plugin creates, plus the shared options.\n */\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\n/**\n * Installs a `QueryClient` on the Vue app, making it available to every descendant component through\n * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin\n * instead of a wrapping component.\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import { VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const app = createApp(App)\n * app.use(VueQueryPlugin)\n * ```\n * @example\n * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per\n * request, or when the same instance also needs to be used outside of Vue components:\n * ```ts\n * import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const queryClient = new QueryClient()\n * app.use(VueQueryPlugin, { queryClient })\n * ```\n * @example\n * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:\n * ```ts\n * app.use(VueQueryPlugin, {\n * queryClientConfig: {\n * defaultOptions: { queries: { staleTime: 5 * 1000 } },\n * },\n * })\n * ```\n */\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!environmentManager.isServer()) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n if (client.isRestoring) {\n client.isRestoring.value = true\n }\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(\n () => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n options.clientPersisterOnSuccess?.(client)\n },\n () => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n },\n )\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root && options.enableDevtoolsV6Plugin) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n if (options.enableDevtoolsV6Plugin) {\n setupDevtools(app, client)\n }\n }\n }\n },\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAa,iBAAiB,EAC5B,UAAU,KAAU,UAAiC,CAAC,MAAM;CAC1D,MAAM,YAAYA,cAAAA,aAAa,QAAQ,cAAc;CACrD,IAAI;CAEJ,IAAI,iBAAiB,WAAW,QAAQ,aACtC,SAAS,QAAQ;MACZ;EACL,MAAM,eACJ,uBAAuB,UAAU,QAAQ,oBAAoB,KAAA;EAC/D,SAAS,IAAIC,oBAAAA,YAAY,YAAY;CACvC;CAEA,IAAI,CAACC,qBAAAA,mBAAmB,SAAS,GAC/B,OAAO,MAAM;CAGf,IAAI,yBAAyB,CAE7B;CAEA,IAAI,QAAQ,iBAAiB;EAC3B,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;EAE7B,MAAM,CAAC,SAAS,WAAW,QAAQ,gBAAgB,MAAM;EACzD,mBAAmB;EACnB,QAAQ,WACA;GACJ,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;GAE7B,QAAQ,2BAA2B,MAAM;EAC3C,SACM;GACJ,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;EAE/B,CACF;CACF;CAEA,MAAM,gBAAgB;EACpB,OAAO,QAAQ;EACf,iBAAiB;CACnB;CAEA,IAAI,IAAI,WACN,IAAI,UAAU,OAAO;MAChB;EACL,MAAM,kBAAkB,IAAI;EAC5B,IAAI,UAAU,SAAS,kBAAkB;GACvC,QAAQ;GACR,gBAAgB;EAClB;CACF;CAEA,IAAIC,SAAAA,QACF,IAAI,MAAM,EACR,eAAe;EAEb,IAAI,CAAC,KAAK,WAAW;GACnB,MAAM,eAAe,CAAC;GACtB,OAAO,eAAe,MAAM,aAAa;IACvC,WAAW;IACX,MAAM,MAAM,OAAO,OAAO,cAAc,CAAC;GAC3C,CAAC;EACH;EAEA,KAAK,UAAU,aAAa;EAE5B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,SAAS,KAAK,SAAS,QAAQ,wBACjC,0BAAA,cAAc,MAAM,MAAM;EAAA;CAGhC,EACF,CAAC;MACI;EACL,IAAI,QAAQ,WAAW,MAAM;EAE7B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,QAAQ,wBACV,0BAAA,cAAc,KAAK,MAAM;EAAA;CAG/B;AACF,EACF"}
@@ -52,6 +52,8 @@ const VueQueryPlugin = { install: (app, options = {}) => {
52
52
  promise.then(() => {
53
53
  if (client.isRestoring) client.isRestoring.value = false;
54
54
  options.clientPersisterOnSuccess?.(client);
55
+ }, () => {
56
+ if (client.isRestoring) client.isRestoring.value = false;
55
57
  });
56
58
  }
57
59
  const cleanup = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"vueQueryPlugin.js","names":["QueryClient"],"sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { environmentManager } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n /** Enables the legacy Vue Devtools v6 plugin panel. Prefer `@tanstack/vue-query-devtools` for Vue 3 apps. */\n enableDevtoolsV6Plugin?: boolean\n /**\n * Distinguishes multiple `QueryClient`s provided in the same app — pass the same key to `useQueryClient` to\n * pick this one. Only needed when installing more than one client.\n */\n queryClientKey?: string\n /**\n * Restores a persisted cache before the app mounts. While it runs, `queryClient.isRestoring` is `true`, which\n * suppresses fetches — see `usePersistQueryClient` in `@tanstack/query-persist-client-core` for building one.\n */\n clientPersister?: ClientPersister\n /** Called once `clientPersister`'s returned promise resolves and the cache has finished restoring. */\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n /** Options for the `QueryClient` the plugin constructs. Ignored if `queryClient` is also set. */\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */\n queryClient?: QueryClient\n}\n\n/**\n * The options accepted by `VueQueryPlugin`: either a `queryClient` to install, or a `queryClientConfig` for the\n * client the plugin creates, plus the shared options.\n */\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\n/**\n * Installs a `QueryClient` on the Vue app, making it available to every descendant component through\n * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin\n * instead of a wrapping component.\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import { VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const app = createApp(App)\n * app.use(VueQueryPlugin)\n * ```\n * @example\n * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per\n * request, or when the same instance also needs to be used outside of Vue components:\n * ```ts\n * import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const queryClient = new QueryClient()\n * app.use(VueQueryPlugin, { queryClient })\n * ```\n * @example\n * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:\n * ```ts\n * app.use(VueQueryPlugin, {\n * queryClientConfig: {\n * defaultOptions: { queries: { staleTime: 5 * 1000 } },\n * },\n * })\n * ```\n */\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!environmentManager.isServer()) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n if (client.isRestoring) {\n client.isRestoring.value = true\n }\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n options.clientPersisterOnSuccess?.(client)\n })\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root && options.enableDevtoolsV6Plugin) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n if (options.enableDevtoolsV6Plugin) {\n setupDevtools(app, client)\n }\n }\n }\n },\n}\n"],"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,IAAI,aAAa,eACvB;OAAA,QAAQ,wBACV,cAAc,KAAK,MAAM;EAAA;CAG/B;AACF,EACF"}
1
+ {"version":3,"file":"vueQueryPlugin.js","names":["QueryClient"],"sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { environmentManager } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from './types'\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n /** Enables the legacy Vue Devtools v6 plugin panel. Prefer `@tanstack/vue-query-devtools` for Vue 3 apps. */\n enableDevtoolsV6Plugin?: boolean\n /**\n * Distinguishes multiple `QueryClient`s provided in the same app — pass the same key to `useQueryClient` to\n * pick this one. Only needed when installing more than one client.\n */\n queryClientKey?: string\n /**\n * Restores a persisted cache before the app mounts. While it runs, `queryClient.isRestoring` is `true`, which\n * suppresses fetches — see `usePersistQueryClient` in `@tanstack/query-persist-client-core` for building one.\n */\n clientPersister?: ClientPersister\n /** Called once `clientPersister`'s returned promise resolves and the cache has finished restoring. */\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n /** Options for the `QueryClient` the plugin constructs. Ignored if `queryClient` is also set. */\n queryClientConfig?: QueryClientConfig\n}\n\ninterface ClientOptions extends CommonOptions {\n /** Use your own `QueryClient` instance instead of having the plugin construct one from `queryClientConfig`. */\n queryClient?: QueryClient\n}\n\n/**\n * The options accepted by `VueQueryPlugin`: either a `queryClient` to install, or a `queryClientConfig` for the\n * client the plugin creates, plus the shared options.\n */\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\n/**\n * Installs a `QueryClient` on the Vue app, making it available to every descendant component through\n * `useQueryClient` — the Vue equivalent of React's `QueryClientProvider`, but wired up as an app-level plugin\n * instead of a wrapping component.\n * @example\n * ```ts\n * import { createApp } from 'vue'\n * import { VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const app = createApp(App)\n * app.use(VueQueryPlugin)\n * ```\n * @example\n * Pass a `queryClient` you constructed yourself — useful for SSR, where you need a fresh `QueryClient` per\n * request, or when the same instance also needs to be used outside of Vue components:\n * ```ts\n * import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query'\n *\n * const queryClient = new QueryClient()\n * app.use(VueQueryPlugin, { queryClient })\n * ```\n * @example\n * Or pass `queryClientConfig` to let the plugin construct the `QueryClient` for you, with your own defaults:\n * ```ts\n * app.use(VueQueryPlugin, {\n * queryClientConfig: {\n * defaultOptions: { queries: { staleTime: 5 * 1000 } },\n * },\n * })\n * ```\n */\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n\n if (!environmentManager.isServer()) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n if (client.isRestoring) {\n client.isRestoring.value = true\n }\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(\n () => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n options.clientPersisterOnSuccess?.(client)\n },\n () => {\n if (client.isRestoring) {\n client.isRestoring.value = false\n }\n },\n )\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root && options.enableDevtoolsV6Plugin) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n if (options.enableDevtoolsV6Plugin) {\n setupDevtools(app, client)\n }\n }\n }\n },\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAa,iBAAiB,EAC5B,UAAU,KAAU,UAAiC,CAAC,MAAM;CAC1D,MAAM,YAAY,aAAa,QAAQ,cAAc;CACrD,IAAI;CAEJ,IAAI,iBAAiB,WAAW,QAAQ,aACtC,SAAS,QAAQ;MACZ;EACL,MAAM,eACJ,uBAAuB,UAAU,QAAQ,oBAAoB,KAAA;EAC/D,SAAS,IAAIA,cAAY,YAAY;CACvC;CAEA,IAAI,CAAC,mBAAmB,SAAS,GAC/B,OAAO,MAAM;CAGf,IAAI,yBAAyB,CAE7B;CAEA,IAAI,QAAQ,iBAAiB;EAC3B,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;EAE7B,MAAM,CAAC,SAAS,WAAW,QAAQ,gBAAgB,MAAM;EACzD,mBAAmB;EACnB,QAAQ,WACA;GACJ,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;GAE7B,QAAQ,2BAA2B,MAAM;EAC3C,SACM;GACJ,IAAI,OAAO,aACT,OAAO,YAAY,QAAQ;EAE/B,CACF;CACF;CAEA,MAAM,gBAAgB;EACpB,OAAO,QAAQ;EACf,iBAAiB;CACnB;CAEA,IAAI,IAAI,WACN,IAAI,UAAU,OAAO;MAChB;EACL,MAAM,kBAAkB,IAAI;EAC5B,IAAI,UAAU,SAAS,kBAAkB;GACvC,QAAQ;GACR,gBAAgB;EAClB;CACF;CAEA,IAAI,QACF,IAAI,MAAM,EACR,eAAe;EAEb,IAAI,CAAC,KAAK,WAAW;GACnB,MAAM,eAAe,CAAC;GACtB,OAAO,eAAe,MAAM,aAAa;IACvC,WAAW;IACX,MAAM,MAAM,OAAO,OAAO,cAAc,CAAC;GAC3C,CAAC;EACH;EAEA,KAAK,UAAU,aAAa;EAE5B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,SAAS,KAAK,SAAS,QAAQ,wBACjC,cAAc,MAAM,MAAM;EAAA;CAGhC,EACF,CAAC;MACI;EACL,IAAI,QAAQ,WAAW,MAAM;EAE7B,IAAI,QAAQ,IAAI,aAAa,eACvB;OAAA,QAAQ,wBACV,cAAc,KAAK,MAAM;EAAA;CAG/B;AACF,EACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/vue-query",
3
- "version": "5.106.1",
3
+ "version": "5.107.0",
4
4
  "description": "Hooks for managing, caching and syncing asynchronous and remote data in Vue",
5
5
  "author": "Damian Osipiuk",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  ],
41
41
  "dependencies": {
42
42
  "@tanstack/match-sorter-utils": "^9.1.2",
43
- "@tanstack/query-core": "5.106.1",
43
+ "@tanstack/query-core": "5.107.0",
44
44
  "@vue/devtools-api": "^6.6.3",
45
45
  "vue-demi": "^0.14.10"
46
46
  },
package/src/index.ts CHANGED
@@ -37,6 +37,7 @@ export type { UseQueryReturnType, UseQueryDefinedReturnType } from './useQuery'
37
37
  export type {
38
38
  UseInfiniteQueryOptions,
39
39
  UseInfiniteQueryReturnType,
40
+ UseInfiniteQueryDefinedReturnType,
40
41
  } from './useInfiniteQuery'
41
42
  export type {
42
43
  MutationResult,
@@ -6,6 +6,7 @@ import type {
6
6
  } from './infiniteQueryOptions'
7
7
  import type {
8
8
  DefaultError,
9
+ DefinedInfiniteQueryObserverResult,
9
10
  InfiniteData,
10
11
  InfiniteQueryObserverOptions,
11
12
  InfiniteQueryObserverResult,
@@ -77,6 +78,17 @@ export type UseInfiniteQueryReturnType<TData, TError> = UseBaseQueryReturnType<
77
78
  InfiniteQueryObserverResult<TData, TError>
78
79
  >
79
80
 
81
+ /**
82
+ * The result of `useInfiniteQuery` when `initialData` is set — `data` is never `undefined` (unless a `select`
83
+ * changes `TData` to include `undefined`).
84
+ */
85
+ export type UseInfiniteQueryDefinedReturnType<TData, TError> =
86
+ UseBaseQueryReturnType<
87
+ TData,
88
+ TError,
89
+ DefinedInfiniteQueryObserverResult<TData, TError>
90
+ >
91
+
80
92
  /**
81
93
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
82
94
  * `initialPageParam`, `getNextPageParam`, `getPreviousPageParam`, and `maxPages`.
@@ -141,7 +153,7 @@ export function useInfiniteQuery<
141
153
  >
142
154
  >,
143
155
  queryClient?: QueryClient,
144
- ): UseInfiniteQueryReturnType<TData, TError>
156
+ ): UseInfiniteQueryDefinedReturnType<TData, TError>
145
157
 
146
158
  /**
147
159
  * The options for `useInfiniteQuery` are identical to `useQuery`, with the addition of
@@ -99,12 +99,19 @@ export const VueQueryPlugin = {
99
99
  }
100
100
  const [unmount, promise] = options.clientPersister(client)
101
101
  persisterUnmount = unmount
102
- promise.then(() => {
103
- if (client.isRestoring) {
104
- client.isRestoring.value = false
105
- }
106
- options.clientPersisterOnSuccess?.(client)
107
- })
102
+ promise.then(
103
+ () => {
104
+ if (client.isRestoring) {
105
+ client.isRestoring.value = false
106
+ }
107
+ options.clientPersisterOnSuccess?.(client)
108
+ },
109
+ () => {
110
+ if (client.isRestoring) {
111
+ client.isRestoring.value = false
112
+ }
113
+ },
114
+ )
108
115
  }
109
116
 
110
117
  const cleanup = () => {
@@ -1 +0,0 @@
1
- {"version":3,"file":"infiniteQueryOptions-CGWmFi6_.d.ts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;;;;KA8BY,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAIlB,QAAQ,KACR,IAAI,SAAS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,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,iBACP,wBAAwB,cAAc,QAAQ,OAAO,WAAW,cAElE,cAAcA,gBACb,2BAA2B,OAAO;;;;;;;;;;;;KCpVzB,oCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;EAEA,0BAEI,kBAAkB,aAAa,cAAc,eAC7C,oBACE,kBAAkB,aAAa,cAAc;;;;;;;;;;;;KAczC,kCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;;;;;;;;EASA,aACI,kBAAkB,aAAa,cAAc,sBACtC,kBAAkB,aAAa,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiC1C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,kCACP,cACA,QACA,OACA,WACA,cAED,kCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;iBA0B7C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,oCACP,cACA,QACA,OACA,WACA,cAED,oCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"infiniteQueryOptions-CkULbee9.d.cts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;;;;KA8BY,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAIlB,QAAQ,KACR,IAAI,SAAS,SAAS;;;;;;;;;EAU1B,gBAAgB,QAAQ;;KAGrB,uBACH,cACA,QACA,OACA,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,cAAc,QAAQ,OAAO,WAAW,cAElE,cAAcA,gBACb,2BAA2B,OAAO;;;;;;;;;;;;KCpVzB,oCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;EAEA,0BAEI,kBAAkB,aAAa,cAAc,eAC7C,oBACE,kBAAkB,aAAa,cAAc;;;;;;;;;;;;KAczC,kCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;;;;;;;;EASA,aACI,kBAAkB,aAAa,cAAc,sBACtC,kBAAkB,aAAa,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiC1C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,kCACP,cACA,QACA,OACA,WACA,cAED,kCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;iBA0B7C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,oCACP,cACA,QACA,OACA,WACA,cAED,oCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"infiniteQueryOptions-CGWmFi6_.d.ts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;;;;KA8BY,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAIlB,QAAQ,KACR,IAAI,SAAS,SAAS;;;;;;;;;EAU1B,gBAAgB,QAAQ;;KAGrB,uBACH,cACA,QACA,OACA,YACA,kBAAkB,WAAW,UAC7B,wBAEE,gBAAgB,cAAc,QAAQ,OAAO,YAAY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;;;;;;KCpVzB,oCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;EAEA,0BAEI,kBAAkB,aAAa,cAAc,eAC7C,oBACE,kBAAkB,aAAa,cAAc;;;;;;;;;;;;KAczC,kCACV,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,wBACE,wBACF,cACA,QACA,OACA,WACA;;;;;;;;EASA,aACI,kBAAkB,aAAa,cAAc,sBACtC,kBAAkB,aAAa,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiC1C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,kCACP,cACA,QACA,OACA,WACA,cAED,kCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;iBA0B7C,qBACd,cACA,SAAS,cACT,QAAQ,aAAa,eACrB,kBAAkB,WAAW,UAC7B,sBAEA,SAAS,oCACP,cACA,QACA,OACA,WACA,cAED,oCACD,cACA,QACA,OACA,WACA,cAEA,oBAAoB,WAAW,aAAa,eAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"infiniteQueryOptions-CkULbee9.d.cts","names":["QueryClient","QueryClient"],"sources":["../../src/useBaseQuery.ts","../../src/useInfiniteQuery.ts","../../src/infiniteQueryOptions.ts"],"mappings":";;;;;;;;;KA8BY,uBACV,OACA,QACA,UAAU,oBAAoB,OAAO,cAEpC,WAAW,UAAU,8DAIlB,QAAQ,KACR,IAAI,SAAS,SAAS;;;;;;;;;EAU1B,gBAAgB,QAAQ;;KAGrB,uBACH,cACA,QACA,OACA,YACA,kBAAkB,WAAW,UAC7B,wBAEE,gBAAgB,cAAc,QAAQ,OAAO,YAAY,aACzD,wBAAwB,cAAc,QAAQ,OAAO,WAAW;;;;;;;;;iBAUpD,aACd,cACA,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