@tanstack/react-query 4.40.2 → 4.42.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.
- package/build/lib/Hydrate.d.ts +1 -1
- package/build/lib/QueryClientProvider.d.ts +1 -1
- package/build/lib/QueryClientProvider.esm.js.map +1 -1
- package/build/lib/QueryClientProvider.js.map +1 -1
- package/build/lib/QueryClientProvider.mjs.map +1 -1
- package/build/lib/QueryErrorResetBoundary.d.ts +1 -1
- package/build/lib/__tests__/infiniteQueryOptions.test.d.ts +2 -0
- package/build/lib/__tests__/infiniteQueryOptions.types.test.d.ts +2 -0
- package/build/lib/__tests__/useSuspenseInfiniteQuery.types.test.d.ts +2 -0
- package/build/lib/__tests__/utils.d.ts +2 -1
- package/build/lib/index.d.ts +3 -0
- package/build/lib/index.esm.js +2 -0
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.js +4 -0
- package/build/lib/index.js.map +1 -1
- package/build/lib/index.mjs +2 -0
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/infiniteQueryOptions.d.ts +14 -0
- package/build/lib/infiniteQueryOptions.esm.js +6 -0
- package/build/lib/infiniteQueryOptions.esm.js.map +1 -0
- package/build/lib/infiniteQueryOptions.js +10 -0
- package/build/lib/infiniteQueryOptions.js.map +1 -0
- package/build/lib/infiniteQueryOptions.mjs +6 -0
- package/build/lib/infiniteQueryOptions.mjs.map +1 -0
- package/build/lib/queryOptions.d.ts +2 -2
- package/build/lib/queryOptions.esm.js.map +1 -1
- package/build/lib/queryOptions.js.map +1 -1
- package/build/lib/queryOptions.mjs.map +1 -1
- package/build/lib/suspense.esm.js +11 -0
- package/build/lib/suspense.esm.js.map +1 -1
- package/build/lib/suspense.js +11 -0
- package/build/lib/suspense.js.map +1 -1
- package/build/lib/suspense.mjs +11 -0
- package/build/lib/suspense.mjs.map +1 -1
- package/build/lib/types.d.ts +3 -1
- package/build/lib/useInfiniteQuery.d.ts +7 -2
- package/build/lib/useInfiniteQuery.esm.js.map +1 -1
- package/build/lib/useInfiniteQuery.js.map +1 -1
- package/build/lib/useInfiniteQuery.mjs.map +1 -1
- package/build/lib/useQuery.d.ts +6 -6
- package/build/lib/useQuery.esm.js.map +1 -1
- package/build/lib/useQuery.js.map +1 -1
- package/build/lib/useQuery.mjs.map +1 -1
- package/build/lib/useSuspenseInfiniteQuery.d.ts +5 -0
- package/build/lib/useSuspenseInfiniteQuery.esm.js +14 -0
- package/build/lib/useSuspenseInfiniteQuery.esm.js.map +1 -0
- package/build/lib/useSuspenseInfiniteQuery.js +18 -0
- package/build/lib/useSuspenseInfiniteQuery.js.map +1 -0
- package/build/lib/useSuspenseInfiniteQuery.mjs +14 -0
- package/build/lib/useSuspenseInfiniteQuery.mjs.map +1 -0
- package/build/umd/index.development.js +26 -0
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +10 -8
- package/src/QueryClientProvider.tsx +1 -1
- package/src/__tests__/infiniteQueryOptions.test.tsx +13 -0
- package/src/__tests__/infiniteQueryOptions.types.test.tsx +111 -0
- package/src/__tests__/queryOptions.types.test.tsx +8 -7
- package/src/__tests__/ssr-hydration.test.tsx +20 -7
- package/src/__tests__/suspense.test.tsx +18 -6
- package/src/__tests__/useMutation.test.tsx +3 -3
- package/src/__tests__/useQueries.test.tsx +164 -35
- package/src/__tests__/useQuery.test.tsx +3 -2
- package/src/__tests__/useSuspenseInfiniteQuery.types.test.tsx +115 -0
- package/src/__tests__/utils.tsx +5 -0
- package/src/index.ts +6 -0
- package/src/infiniteQueryOptions.ts +95 -0
- package/src/queryOptions.ts +8 -2
- package/src/types.ts +14 -0
- package/src/useInfiniteQuery.ts +28 -1
- package/src/useQuery.ts +6 -6
- package/src/useSuspenseInfiniteQuery.ts +62 -0
- package/build/lib/Hydrate.d.ts.map +0 -1
- package/build/lib/QueryClientProvider.d.ts.map +0 -1
- package/build/lib/QueryErrorResetBoundary.d.ts.map +0 -1
- package/build/lib/__tests__/Hydrate.test.d.ts.map +0 -1
- package/build/lib/__tests__/QueryClientProvider.test.d.ts.map +0 -1
- package/build/lib/__tests__/QueryResetErrorBoundary.test.d.ts.map +0 -1
- package/build/lib/__tests__/queryOptions.types.test.d.ts.map +0 -1
- package/build/lib/__tests__/ssr-hydration.test.d.ts.map +0 -1
- package/build/lib/__tests__/ssr.test.d.ts.map +0 -1
- package/build/lib/__tests__/suspense.test.d.ts.map +0 -1
- package/build/lib/__tests__/useInfiniteQuery.test.d.ts.map +0 -1
- package/build/lib/__tests__/useIsFetching.test.d.ts.map +0 -1
- package/build/lib/__tests__/useIsMutating.test.d.ts.map +0 -1
- package/build/lib/__tests__/useMutation.test.d.ts.map +0 -1
- package/build/lib/__tests__/useQueries.test.d.ts.map +0 -1
- package/build/lib/__tests__/useQuery.test.d.ts.map +0 -1
- package/build/lib/__tests__/useQuery.types.test.d.ts.map +0 -1
- package/build/lib/__tests__/useSuspenseQueries.types.test.d.ts.map +0 -1
- package/build/lib/__tests__/useSuspenseQuery.types.test.d.ts.map +0 -1
- package/build/lib/__tests__/utils.d.ts.map +0 -1
- package/build/lib/errorBoundaryUtils.d.ts.map +0 -1
- package/build/lib/index.d.ts.map +0 -1
- package/build/lib/isRestoring.d.ts.map +0 -1
- package/build/lib/queryOptions.d.ts.map +0 -1
- package/build/lib/reactBatchedUpdates.d.ts.map +0 -1
- package/build/lib/reactBatchedUpdates.native.d.ts.map +0 -1
- package/build/lib/setBatchUpdatesFn.d.ts.map +0 -1
- package/build/lib/suspense.d.ts.map +0 -1
- package/build/lib/types.d.ts.map +0 -1
- package/build/lib/useBaseQuery.d.ts.map +0 -1
- package/build/lib/useInfiniteQuery.d.ts.map +0 -1
- package/build/lib/useIsFetching.d.ts.map +0 -1
- package/build/lib/useIsMutating.d.ts.map +0 -1
- package/build/lib/useMutation.d.ts.map +0 -1
- package/build/lib/useQueries.d.ts.map +0 -1
- package/build/lib/useQuery.d.ts.map +0 -1
- package/build/lib/useSuspenseQueries.d.ts.map +0 -1
- package/build/lib/useSuspenseQuery.d.ts.map +0 -1
- package/build/lib/useSyncExternalStore.d.ts.map +0 -1
- package/build/lib/useSyncExternalStore.native.d.ts.map +0 -1
- package/build/lib/utils.d.ts.map +0 -1
package/build/lib/Hydrate.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ export interface HydrateProps {
|
|
|
7
7
|
options?: HydrateOptions;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
export declare const Hydrate: ({ children, options, state }: HydrateProps) => React.ReactElement<
|
|
10
|
+
export declare const Hydrate: ({ children, options, state }: HydrateProps) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
11
11
|
//# sourceMappingURL=Hydrate.d.ts.map
|
|
@@ -20,6 +20,6 @@ declare type QueryClientProviderPropsWithContextSharing = {
|
|
|
20
20
|
contextSharing?: boolean;
|
|
21
21
|
} & QueryClientProviderPropsBase;
|
|
22
22
|
export declare type QueryClientProviderProps = QueryClientProviderPropsWithContext | QueryClientProviderPropsWithContextSharing;
|
|
23
|
-
export declare const QueryClientProvider: ({ client, children, context, contextSharing, }: QueryClientProviderProps) => JSX.Element;
|
|
23
|
+
export declare const QueryClientProvider: ({ client, children, context, contextSharing, }: QueryClientProviderProps) => React.JSX.Element;
|
|
24
24
|
export {};
|
|
25
25
|
//# sourceMappingURL=QueryClientProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryClientProvider.esm.js","sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\nimport type { ContextOptions } from './types'\n\ndeclare global {\n interface Window {\n ReactQueryClientContext?: React.Context<QueryClient | undefined>\n }\n}\n\nexport const defaultContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\nconst QueryClientSharingContext = React.createContext<boolean>(false)\n\n// If we are given a context, we will use it.\n// Otherwise, if contextSharing is on, we share the first and at least one\n// instance of the context across the window\n// to ensure that if React Query is used across\n// different bundles or microfrontends they will\n// all use the same **instance** of context, regardless\n// of module scoping.\nfunction getQueryClientContext(\n context: React.Context<QueryClient | undefined> | undefined,\n contextSharing: boolean,\n) {\n if (context) {\n return context\n }\n if (contextSharing && typeof window !== 'undefined') {\n if (!window.ReactQueryClientContext) {\n window.ReactQueryClientContext = defaultContext\n }\n\n return window.ReactQueryClientContext\n }\n\n return defaultContext\n}\n\nexport const useQueryClient = ({ context }: ContextOptions = {}) => {\n const queryClient = React.useContext(\n getQueryClientContext(context, React.useContext(QueryClientSharingContext)),\n )\n\n if (!queryClient) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return queryClient\n}\n\ntype QueryClientProviderPropsBase = {\n client: QueryClient\n children?: React.ReactNode\n}\ntype QueryClientProviderPropsWithContext = ContextOptions & {\n contextSharing?: never\n} & QueryClientProviderPropsBase\ntype QueryClientProviderPropsWithContextSharing = {\n context?: never\n contextSharing?: boolean\n} & QueryClientProviderPropsBase\n\nexport type QueryClientProviderProps =\n | QueryClientProviderPropsWithContext\n | QueryClientProviderPropsWithContextSharing\n\nexport const QueryClientProvider = ({\n client,\n children,\n context,\n contextSharing = false,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n if (process.env.NODE_ENV !== 'production' && contextSharing) {\n client\n .getLogger()\n .error(\n `The contextSharing option has been deprecated and will be removed in the next major version`,\n )\n }\n\n const Context = getQueryClientContext(context, contextSharing)\n\n return (\n <QueryClientSharingContext.Provider value={!context && contextSharing}>\n <Context.Provider value={client}>{children}</Context.Provider>\n </QueryClientSharingContext.Provider>\n )\n}\n"],"names":["context","contextSharing","client"],"mappings":";;;AAYO;AAGP;AAGA;AACA;AACA;AACA;AACA;AACA;;AACA;AAIE;AACE;AACD;;AACD;AACE;;AAEC;;;AAGF;;AAED;AACD;;AAEM;AAA0BA;AAAF;AAC7B;;;AAKE;AACD;;AAED;AACD;AAkBM;;;;AAILC;AAJkC;;AAOhCC;AACA;AACEA;;;;;;AAUH;;AAED;;;;AAIsB;;AAGvB;;"}
|
|
1
|
+
{"version":3,"file":"QueryClientProvider.esm.js","sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\nimport type { ContextOptions } from './types'\n\ndeclare global {\n interface Window {\n ReactQueryClientContext?: React.Context<QueryClient | undefined>\n }\n}\n\nexport const defaultContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\nconst QueryClientSharingContext = React.createContext<boolean>(false)\n\n// If we are given a context, we will use it.\n// Otherwise, if contextSharing is on, we share the first and at least one\n// instance of the context across the window\n// to ensure that if React Query is used across\n// different bundles or microfrontends they will\n// all use the same **instance** of context, regardless\n// of module scoping.\nfunction getQueryClientContext(\n context: React.Context<QueryClient | undefined> | undefined,\n contextSharing: boolean,\n) {\n if (context) {\n return context\n }\n if (contextSharing && typeof window !== 'undefined') {\n if (!window.ReactQueryClientContext) {\n window.ReactQueryClientContext = defaultContext\n }\n\n return window.ReactQueryClientContext\n }\n\n return defaultContext\n}\n\nexport const useQueryClient = ({ context }: ContextOptions = {}) => {\n const queryClient = React.useContext(\n getQueryClientContext(context, React.useContext(QueryClientSharingContext)),\n )\n\n if (!queryClient) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return queryClient\n}\n\ntype QueryClientProviderPropsBase = {\n client: QueryClient\n children?: React.ReactNode\n}\ntype QueryClientProviderPropsWithContext = ContextOptions & {\n contextSharing?: never\n} & QueryClientProviderPropsBase\ntype QueryClientProviderPropsWithContextSharing = {\n context?: never\n contextSharing?: boolean\n} & QueryClientProviderPropsBase\n\nexport type QueryClientProviderProps =\n | QueryClientProviderPropsWithContext\n | QueryClientProviderPropsWithContextSharing\n\nexport const QueryClientProvider = ({\n client,\n children,\n context,\n contextSharing = false,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n if (process.env.NODE_ENV !== 'production' && contextSharing) {\n client\n .getLogger()\n .error(\n `The contextSharing option has been deprecated and will be removed in the next major version`,\n )\n }\n\n const Context = getQueryClientContext(context, contextSharing)\n\n return (\n <QueryClientSharingContext.Provider value={!context && contextSharing}>\n <Context.Provider value={client}>{children}</Context.Provider>\n </QueryClientSharingContext.Provider>\n )\n}\n"],"names":["context","contextSharing","client"],"mappings":";;;AAYO;AAGP;AAGA;AACA;AACA;AACA;AACA;AACA;;AACA;AAIE;AACE;AACD;;AACD;AACE;;AAEC;;;AAGF;;AAED;AACD;;AAEM;AAA0BA;AAAF;AAC7B;;;AAKE;AACD;;AAED;AACD;AAkBM;;;;AAILC;AAJkC;;AAOhCC;AACA;AACEA;;;;;;AAUH;;AAED;;;;AAIsB;;AAGvB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryClientProvider.js","sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\nimport type { ContextOptions } from './types'\n\ndeclare global {\n interface Window {\n ReactQueryClientContext?: React.Context<QueryClient | undefined>\n }\n}\n\nexport const defaultContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\nconst QueryClientSharingContext = React.createContext<boolean>(false)\n\n// If we are given a context, we will use it.\n// Otherwise, if contextSharing is on, we share the first and at least one\n// instance of the context across the window\n// to ensure that if React Query is used across\n// different bundles or microfrontends they will\n// all use the same **instance** of context, regardless\n// of module scoping.\nfunction getQueryClientContext(\n context: React.Context<QueryClient | undefined> | undefined,\n contextSharing: boolean,\n) {\n if (context) {\n return context\n }\n if (contextSharing && typeof window !== 'undefined') {\n if (!window.ReactQueryClientContext) {\n window.ReactQueryClientContext = defaultContext\n }\n\n return window.ReactQueryClientContext\n }\n\n return defaultContext\n}\n\nexport const useQueryClient = ({ context }: ContextOptions = {}) => {\n const queryClient = React.useContext(\n getQueryClientContext(context, React.useContext(QueryClientSharingContext)),\n )\n\n if (!queryClient) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return queryClient\n}\n\ntype QueryClientProviderPropsBase = {\n client: QueryClient\n children?: React.ReactNode\n}\ntype QueryClientProviderPropsWithContext = ContextOptions & {\n contextSharing?: never\n} & QueryClientProviderPropsBase\ntype QueryClientProviderPropsWithContextSharing = {\n context?: never\n contextSharing?: boolean\n} & QueryClientProviderPropsBase\n\nexport type QueryClientProviderProps =\n | QueryClientProviderPropsWithContext\n | QueryClientProviderPropsWithContextSharing\n\nexport const QueryClientProvider = ({\n client,\n children,\n context,\n contextSharing = false,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n if (process.env.NODE_ENV !== 'production' && contextSharing) {\n client\n .getLogger()\n .error(\n `The contextSharing option has been deprecated and will be removed in the next major version`,\n )\n }\n\n const Context = getQueryClientContext(context, contextSharing)\n\n return (\n <QueryClientSharingContext.Provider value={!context && contextSharing}>\n <Context.Provider value={client}>{children}</Context.Provider>\n </QueryClientSharingContext.Provider>\n )\n}\n"],"names":["context","contextSharing","client"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO;AAGP;AAGA;AACA;AACA;AACA;AACA;AACA;;AACA;AAIE;AACE;AACD;;AACD;AACE;;AAEC;;;AAGF;;AAED;AACD;;AAEM;AAA0BA;AAAF;AAC7B;;;AAKE;AACD;;AAED;AACD;AAkBM;;;;AAILC;AAJkC;;AAOhCC;AACA;AACEA;;;;;;AAUH;;AAED;;;;AAIsB;;AAGvB;;;;"}
|
|
1
|
+
{"version":3,"file":"QueryClientProvider.js","sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\nimport type { ContextOptions } from './types'\n\ndeclare global {\n interface Window {\n ReactQueryClientContext?: React.Context<QueryClient | undefined>\n }\n}\n\nexport const defaultContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\nconst QueryClientSharingContext = React.createContext<boolean>(false)\n\n// If we are given a context, we will use it.\n// Otherwise, if contextSharing is on, we share the first and at least one\n// instance of the context across the window\n// to ensure that if React Query is used across\n// different bundles or microfrontends they will\n// all use the same **instance** of context, regardless\n// of module scoping.\nfunction getQueryClientContext(\n context: React.Context<QueryClient | undefined> | undefined,\n contextSharing: boolean,\n) {\n if (context) {\n return context\n }\n if (contextSharing && typeof window !== 'undefined') {\n if (!window.ReactQueryClientContext) {\n window.ReactQueryClientContext = defaultContext\n }\n\n return window.ReactQueryClientContext\n }\n\n return defaultContext\n}\n\nexport const useQueryClient = ({ context }: ContextOptions = {}) => {\n const queryClient = React.useContext(\n getQueryClientContext(context, React.useContext(QueryClientSharingContext)),\n )\n\n if (!queryClient) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return queryClient\n}\n\ntype QueryClientProviderPropsBase = {\n client: QueryClient\n children?: React.ReactNode\n}\ntype QueryClientProviderPropsWithContext = ContextOptions & {\n contextSharing?: never\n} & QueryClientProviderPropsBase\ntype QueryClientProviderPropsWithContextSharing = {\n context?: never\n contextSharing?: boolean\n} & QueryClientProviderPropsBase\n\nexport type QueryClientProviderProps =\n | QueryClientProviderPropsWithContext\n | QueryClientProviderPropsWithContextSharing\n\nexport const QueryClientProvider = ({\n client,\n children,\n context,\n contextSharing = false,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n if (process.env.NODE_ENV !== 'production' && contextSharing) {\n client\n .getLogger()\n .error(\n `The contextSharing option has been deprecated and will be removed in the next major version`,\n )\n }\n\n const Context = getQueryClientContext(context, contextSharing)\n\n return (\n <QueryClientSharingContext.Provider value={!context && contextSharing}>\n <Context.Provider value={client}>{children}</Context.Provider>\n </QueryClientSharingContext.Provider>\n )\n}\n"],"names":["context","contextSharing","client"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO;AAGP;AAGA;AACA;AACA;AACA;AACA;AACA;;AACA;AAIE;AACE;AACD;;AACD;AACE;;AAEC;;;AAGF;;AAED;AACD;;AAEM;AAA0BA;AAAF;AAC7B;;;AAKE;AACD;;AAED;AACD;AAkBM;;;;AAILC;AAJkC;;AAOhCC;AACA;AACEA;;;;;;AAUH;;AAED;;;;AAIsB;;AAGvB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryClientProvider.mjs","sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\nimport type { ContextOptions } from './types'\n\ndeclare global {\n interface Window {\n ReactQueryClientContext?: React.Context<QueryClient | undefined>\n }\n}\n\nexport const defaultContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\nconst QueryClientSharingContext = React.createContext<boolean>(false)\n\n// If we are given a context, we will use it.\n// Otherwise, if contextSharing is on, we share the first and at least one\n// instance of the context across the window\n// to ensure that if React Query is used across\n// different bundles or microfrontends they will\n// all use the same **instance** of context, regardless\n// of module scoping.\nfunction getQueryClientContext(\n context: React.Context<QueryClient | undefined> | undefined,\n contextSharing: boolean,\n) {\n if (context) {\n return context\n }\n if (contextSharing && typeof window !== 'undefined') {\n if (!window.ReactQueryClientContext) {\n window.ReactQueryClientContext = defaultContext\n }\n\n return window.ReactQueryClientContext\n }\n\n return defaultContext\n}\n\nexport const useQueryClient = ({ context }: ContextOptions = {}) => {\n const queryClient = React.useContext(\n getQueryClientContext(context, React.useContext(QueryClientSharingContext)),\n )\n\n if (!queryClient) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return queryClient\n}\n\ntype QueryClientProviderPropsBase = {\n client: QueryClient\n children?: React.ReactNode\n}\ntype QueryClientProviderPropsWithContext = ContextOptions & {\n contextSharing?: never\n} & QueryClientProviderPropsBase\ntype QueryClientProviderPropsWithContextSharing = {\n context?: never\n contextSharing?: boolean\n} & QueryClientProviderPropsBase\n\nexport type QueryClientProviderProps =\n | QueryClientProviderPropsWithContext\n | QueryClientProviderPropsWithContextSharing\n\nexport const QueryClientProvider = ({\n client,\n children,\n context,\n contextSharing = false,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n if (process.env.NODE_ENV !== 'production' && contextSharing) {\n client\n .getLogger()\n .error(\n `The contextSharing option has been deprecated and will be removed in the next major version`,\n )\n }\n\n const Context = getQueryClientContext(context, contextSharing)\n\n return (\n <QueryClientSharingContext.Provider value={!context && contextSharing}>\n <Context.Provider value={client}>{children}</Context.Provider>\n </QueryClientSharingContext.Provider>\n )\n}\n"],"names":["context","contextSharing","client"],"mappings":";;;AAYO;AAGP;AAGA;AACA;AACA;AACA;AACA;AACA;;AACA;AAIE;AACE;AACD;;AACD;AACE;;AAEC;;;AAGF;;AAED;AACD;;AAEM;AAA0BA;AAAF;AAC7B;;;AAKE;AACD;;AAED;AACD;AAkBM;;;;AAILC;AAJkC;;AAOhCC;AACA;AACEA;;;;;;AAUH;;AAED;;;;AAIsB;;AAGvB;;"}
|
|
1
|
+
{"version":3,"file":"QueryClientProvider.mjs","sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\nimport type { ContextOptions } from './types'\n\ndeclare global {\n interface Window {\n ReactQueryClientContext?: React.Context<QueryClient | undefined>\n }\n}\n\nexport const defaultContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\nconst QueryClientSharingContext = React.createContext<boolean>(false)\n\n// If we are given a context, we will use it.\n// Otherwise, if contextSharing is on, we share the first and at least one\n// instance of the context across the window\n// to ensure that if React Query is used across\n// different bundles or microfrontends they will\n// all use the same **instance** of context, regardless\n// of module scoping.\nfunction getQueryClientContext(\n context: React.Context<QueryClient | undefined> | undefined,\n contextSharing: boolean,\n) {\n if (context) {\n return context\n }\n if (contextSharing && typeof window !== 'undefined') {\n if (!window.ReactQueryClientContext) {\n window.ReactQueryClientContext = defaultContext\n }\n\n return window.ReactQueryClientContext\n }\n\n return defaultContext\n}\n\nexport const useQueryClient = ({ context }: ContextOptions = {}) => {\n const queryClient = React.useContext(\n getQueryClientContext(context, React.useContext(QueryClientSharingContext)),\n )\n\n if (!queryClient) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return queryClient\n}\n\ntype QueryClientProviderPropsBase = {\n client: QueryClient\n children?: React.ReactNode\n}\ntype QueryClientProviderPropsWithContext = ContextOptions & {\n contextSharing?: never\n} & QueryClientProviderPropsBase\ntype QueryClientProviderPropsWithContextSharing = {\n context?: never\n contextSharing?: boolean\n} & QueryClientProviderPropsBase\n\nexport type QueryClientProviderProps =\n | QueryClientProviderPropsWithContext\n | QueryClientProviderPropsWithContextSharing\n\nexport const QueryClientProvider = ({\n client,\n children,\n context,\n contextSharing = false,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n if (process.env.NODE_ENV !== 'production' && contextSharing) {\n client\n .getLogger()\n .error(\n `The contextSharing option has been deprecated and will be removed in the next major version`,\n )\n }\n\n const Context = getQueryClientContext(context, contextSharing)\n\n return (\n <QueryClientSharingContext.Provider value={!context && contextSharing}>\n <Context.Provider value={client}>{children}</Context.Provider>\n </QueryClientSharingContext.Provider>\n )\n}\n"],"names":["context","contextSharing","client"],"mappings":";;;AAYO;AAGP;AAGA;AACA;AACA;AACA;AACA;AACA;;AACA;AAIE;AACE;AACD;;AACD;AACE;;AAEC;;;AAGF;;AAED;AACD;;AAEM;AAA0BA;AAAF;AAC7B;;;AAKE;AACD;;AAED;AACD;AAkBM;;;;AAILC;AAJkC;;AAOhCC;AACA;AACEA;;;;;;AAUH;;AAED;;;;AAIsB;;AAGvB;;"}
|
|
@@ -8,5 +8,5 @@ export declare const useQueryErrorResetBoundary: () => QueryErrorResetBoundaryVa
|
|
|
8
8
|
export interface QueryErrorResetBoundaryProps {
|
|
9
9
|
children: ((value: QueryErrorResetBoundaryValue) => React.ReactNode) | React.ReactNode;
|
|
10
10
|
}
|
|
11
|
-
export declare const QueryErrorResetBoundary: ({ children, }: QueryErrorResetBoundaryProps) => JSX.Element;
|
|
11
|
+
export declare const QueryErrorResetBoundary: ({ children, }: QueryErrorResetBoundaryProps) => React.JSX.Element;
|
|
12
12
|
//# sourceMappingURL=QueryErrorResetBoundary.d.ts.map
|
|
@@ -9,7 +9,7 @@ export declare function renderWithClient(client: QueryClient, ui: React.ReactEle
|
|
|
9
9
|
export declare const Blink: ({ duration, children, }: {
|
|
10
10
|
duration: number;
|
|
11
11
|
children: React.ReactNode;
|
|
12
|
-
}) => JSX.Element;
|
|
12
|
+
}) => React.JSX.Element;
|
|
13
13
|
export declare function createQueryClient(config?: QueryClientConfig): QueryClient;
|
|
14
14
|
export declare function mockVisibilityState(value: DocumentVisibilityState): jest.SpyInstance<DocumentVisibilityState, []>;
|
|
15
15
|
export declare function mockNavigatorOnLine(value: boolean): jest.SpyInstance<boolean, []>;
|
|
@@ -31,4 +31,5 @@ export declare function expectType<T>(_: T): void;
|
|
|
31
31
|
export declare function expectTypeNotAny<T>(_: 0 extends 1 & T ? never : T): void;
|
|
32
32
|
export declare function executeMutation(queryClient: QueryClient, options: MutationOptions<any, any, any, any>): Promise<unknown>;
|
|
33
33
|
export declare function setIsServer(isServer: boolean): () => void;
|
|
34
|
+
export declare function reactVersion(): "17" | "18" | "19";
|
|
34
35
|
//# sourceMappingURL=utils.d.ts.map
|
package/build/lib/index.d.ts
CHANGED
|
@@ -5,10 +5,13 @@ export { useQueries } from './useQueries';
|
|
|
5
5
|
export type { QueriesResults, QueriesOptions } from './useQueries';
|
|
6
6
|
export { useQuery } from './useQuery';
|
|
7
7
|
export { useSuspenseQuery } from './useSuspenseQuery';
|
|
8
|
+
export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery';
|
|
8
9
|
export { useSuspenseQueries } from './useSuspenseQueries';
|
|
9
10
|
export type { SuspenseQueriesResults, SuspenseQueriesOptions, } from './useSuspenseQueries';
|
|
10
11
|
export { queryOptions } from './queryOptions';
|
|
11
12
|
export type { DefinedInitialDataOptions, UndefinedInitialDataOptions, } from './queryOptions';
|
|
13
|
+
export { infiniteQueryOptions } from './infiniteQueryOptions';
|
|
14
|
+
export type { DefinedInitialDataInfiniteOptions, UndefinedInitialDataInfiniteOptions, } from './infiniteQueryOptions';
|
|
12
15
|
export { defaultContext, QueryClientProvider, useQueryClient, } from './QueryClientProvider';
|
|
13
16
|
export type { QueryClientProviderProps } from './QueryClientProvider';
|
|
14
17
|
export type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary';
|
package/build/lib/index.esm.js
CHANGED
|
@@ -3,8 +3,10 @@ export * from '@tanstack/query-core';
|
|
|
3
3
|
export { useQueries } from './useQueries.esm.js';
|
|
4
4
|
export { useQuery } from './useQuery.esm.js';
|
|
5
5
|
export { useSuspenseQuery } from './useSuspenseQuery.esm.js';
|
|
6
|
+
export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.esm.js';
|
|
6
7
|
export { useSuspenseQueries } from './useSuspenseQueries.esm.js';
|
|
7
8
|
export { queryOptions } from './queryOptions.esm.js';
|
|
9
|
+
export { infiniteQueryOptions } from './infiniteQueryOptions.esm.js';
|
|
8
10
|
export { QueryClientProvider, defaultContext, useQueryClient } from './QueryClientProvider.esm.js';
|
|
9
11
|
export { Hydrate, useHydrate } from './Hydrate.esm.js';
|
|
10
12
|
export { QueryErrorResetBoundary, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.esm.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
package/build/lib/index.js
CHANGED
|
@@ -7,8 +7,10 @@ var queryCore = require('@tanstack/query-core');
|
|
|
7
7
|
var useQueries = require('./useQueries.js');
|
|
8
8
|
var useQuery = require('./useQuery.js');
|
|
9
9
|
var useSuspenseQuery = require('./useSuspenseQuery.js');
|
|
10
|
+
var useSuspenseInfiniteQuery = require('./useSuspenseInfiniteQuery.js');
|
|
10
11
|
var useSuspenseQueries = require('./useSuspenseQueries.js');
|
|
11
12
|
var queryOptions = require('./queryOptions.js');
|
|
13
|
+
var infiniteQueryOptions = require('./infiniteQueryOptions.js');
|
|
12
14
|
var QueryClientProvider = require('./QueryClientProvider.js');
|
|
13
15
|
var Hydrate = require('./Hydrate.js');
|
|
14
16
|
var QueryErrorResetBoundary = require('./QueryErrorResetBoundary.js');
|
|
@@ -23,8 +25,10 @@ var isRestoring = require('./isRestoring.js');
|
|
|
23
25
|
exports.useQueries = useQueries.useQueries;
|
|
24
26
|
exports.useQuery = useQuery.useQuery;
|
|
25
27
|
exports.useSuspenseQuery = useSuspenseQuery.useSuspenseQuery;
|
|
28
|
+
exports.useSuspenseInfiniteQuery = useSuspenseInfiniteQuery.useSuspenseInfiniteQuery;
|
|
26
29
|
exports.useSuspenseQueries = useSuspenseQueries.useSuspenseQueries;
|
|
27
30
|
exports.queryOptions = queryOptions.queryOptions;
|
|
31
|
+
exports.infiniteQueryOptions = infiniteQueryOptions.infiniteQueryOptions;
|
|
28
32
|
exports.QueryClientProvider = QueryClientProvider.QueryClientProvider;
|
|
29
33
|
exports.defaultContext = QueryClientProvider.defaultContext;
|
|
30
34
|
exports.useQueryClient = QueryClientProvider.useQueryClient;
|
package/build/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/lib/index.mjs
CHANGED
|
@@ -3,8 +3,10 @@ export * from '@tanstack/query-core';
|
|
|
3
3
|
export { useQueries } from './useQueries.mjs';
|
|
4
4
|
export { useQuery } from './useQuery.mjs';
|
|
5
5
|
export { useSuspenseQuery } from './useSuspenseQuery.mjs';
|
|
6
|
+
export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.mjs';
|
|
6
7
|
export { useSuspenseQueries } from './useSuspenseQueries.mjs';
|
|
7
8
|
export { queryOptions } from './queryOptions.mjs';
|
|
9
|
+
export { infiniteQueryOptions } from './infiniteQueryOptions.mjs';
|
|
8
10
|
export { QueryClientProvider, defaultContext, useQueryClient } from './QueryClientProvider.mjs';
|
|
9
11
|
export { Hydrate, useHydrate } from './Hydrate.mjs';
|
|
10
12
|
export { QueryErrorResetBoundary, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.mjs';
|
package/build/lib/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { UseInfiniteQueryOptions } from './types';
|
|
2
|
+
import type { InfiniteData, NonUndefinedGuard, OmitKeyof, QueryKey, WithRequired } from '@tanstack/query-core';
|
|
3
|
+
declare type UseInfiniteQueryOptionsOmitted<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = OmitKeyof<UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>, 'onSuccess' | 'onError' | 'onSettled' | 'refetchInterval'>;
|
|
4
|
+
declare type ProhibitedInfiniteQueryOptionsKeyInV5 = keyof Pick<UseInfiniteQueryOptionsOmitted, 'useErrorBoundary' | 'suspense'>;
|
|
5
|
+
export declare type UndefinedInitialDataInfiniteOptions<TQueryFnData, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = UseInfiniteQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {
|
|
6
|
+
initialData?: undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare type DefinedInitialDataInfiniteOptions<TQueryFnData, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = UseInfiniteQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {
|
|
9
|
+
initialData: NonUndefinedGuard<InfiniteData<TQueryFnData>> | (() => NonUndefinedGuard<InfiniteData<TQueryFnData>>) | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare function infiniteQueryOptions<TQueryFnData, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: WithRequired<OmitKeyof<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey>, ProhibitedInfiniteQueryOptionsKeyInV5>, 'queryKey'>): WithRequired<OmitKeyof<DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey>, ProhibitedInfiniteQueryOptionsKeyInV5>, 'queryKey'>;
|
|
12
|
+
export declare function infiniteQueryOptions<TQueryFnData, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: WithRequired<OmitKeyof<UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey>, ProhibitedInfiniteQueryOptionsKeyInV5>, 'queryKey'>): WithRequired<OmitKeyof<UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey>, ProhibitedInfiniteQueryOptionsKeyInV5>, 'queryKey'>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=infiniteQueryOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infiniteQueryOptions.esm.js","sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type { UseInfiniteQueryOptions } from './types'\nimport type {\n InfiniteData,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n WithRequired,\n} from '@tanstack/query-core'\n\ntype UseInfiniteQueryOptionsOmitted<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>,\n 'onSuccess' | 'onError' | 'onSettled' | 'refetchInterval'\n>\n\ntype ProhibitedInfiniteQueryOptionsKeyInV5 = keyof Pick<\n UseInfiniteQueryOptionsOmitted,\n 'useErrorBoundary' | 'suspense'\n>\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseInfiniteQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData?: undefined\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseInfiniteQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData:\n | NonUndefinedGuard<InfiniteData<TQueryFnData>>\n | (() => NonUndefinedGuard<InfiniteData<TQueryFnData>>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedInfiniteQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n OmitKeyof<\n DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedInfiniteQueryOptionsKeyInV5\n >,\n 'queryKey'\n>\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >,\n ProhibitedInfiniteQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n OmitKeyof<\n UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedInfiniteQueryOptionsKeyInV5\n >,\n 'queryKey'\n>\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"names":["infiniteQueryOptions","options"],"mappings":"AA4FO,SAASA,oBAAT,CAA8BC,OAA9B,EAAgD;AACrD,EAAA,OAAOA,OAAP,CAAA;AACD;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infiniteQueryOptions.js","sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type { UseInfiniteQueryOptions } from './types'\nimport type {\n InfiniteData,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n WithRequired,\n} from '@tanstack/query-core'\n\ntype UseInfiniteQueryOptionsOmitted<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>,\n 'onSuccess' | 'onError' | 'onSettled' | 'refetchInterval'\n>\n\ntype ProhibitedInfiniteQueryOptionsKeyInV5 = keyof Pick<\n UseInfiniteQueryOptionsOmitted,\n 'useErrorBoundary' | 'suspense'\n>\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseInfiniteQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData?: undefined\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseInfiniteQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData:\n | NonUndefinedGuard<InfiniteData<TQueryFnData>>\n | (() => NonUndefinedGuard<InfiniteData<TQueryFnData>>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedInfiniteQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n OmitKeyof<\n DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedInfiniteQueryOptionsKeyInV5\n >,\n 'queryKey'\n>\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >,\n ProhibitedInfiniteQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n OmitKeyof<\n UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedInfiniteQueryOptionsKeyInV5\n >,\n 'queryKey'\n>\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"names":["infiniteQueryOptions","options"],"mappings":";;;;AA4FO,SAASA,oBAAT,CAA8BC,OAA9B,EAAgD;AACrD,EAAA,OAAOA,OAAP,CAAA;AACD;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infiniteQueryOptions.mjs","sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type { UseInfiniteQueryOptions } from './types'\nimport type {\n InfiniteData,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n WithRequired,\n} from '@tanstack/query-core'\n\ntype UseInfiniteQueryOptionsOmitted<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>,\n 'onSuccess' | 'onError' | 'onSettled' | 'refetchInterval'\n>\n\ntype ProhibitedInfiniteQueryOptionsKeyInV5 = keyof Pick<\n UseInfiniteQueryOptionsOmitted,\n 'useErrorBoundary' | 'suspense'\n>\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseInfiniteQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData?: undefined\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseInfiniteQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData:\n | NonUndefinedGuard<InfiniteData<TQueryFnData>>\n | (() => NonUndefinedGuard<InfiniteData<TQueryFnData>>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedInfiniteQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n OmitKeyof<\n DefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedInfiniteQueryOptionsKeyInV5\n >,\n 'queryKey'\n>\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >,\n ProhibitedInfiniteQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n OmitKeyof<\n UndefinedInitialDataInfiniteOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedInfiniteQueryOptionsKeyInV5\n >,\n 'queryKey'\n>\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"names":["infiniteQueryOptions","options"],"mappings":"AA4FO,SAASA,oBAAT,CAA8BC,OAA9B,EAAgD;AACrD,EAAA,OAAOA,OAAP,CAAA;AACD;;;;"}
|
|
@@ -8,7 +8,7 @@ export declare type UndefinedInitialDataOptions<TQueryFnData = unknown, TError =
|
|
|
8
8
|
export declare type DefinedInitialDataOptions<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> = UseQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {
|
|
9
9
|
initialData: NonUndefinedGuard<TQueryFnData> | (() => NonUndefinedGuard<TQueryFnData>);
|
|
10
10
|
};
|
|
11
|
-
export declare function queryOptions<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: WithRequired<OmitKeyof<DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, ProhibitedQueryOptionsKeyInV5>, 'queryKey'>): WithRequired<DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey'>;
|
|
12
|
-
export declare function queryOptions<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: WithRequired<OmitKeyof<UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, ProhibitedQueryOptionsKeyInV5>, 'queryKey'>): WithRequired<UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey'>;
|
|
11
|
+
export declare function queryOptions<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: WithRequired<OmitKeyof<DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, ProhibitedQueryOptionsKeyInV5>, 'queryKey'>): WithRequired<OmitKeyof<DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, ProhibitedQueryOptionsKeyInV5>, 'queryKey'>;
|
|
12
|
+
export declare function queryOptions<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: WithRequired<OmitKeyof<UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, ProhibitedQueryOptionsKeyInV5>, 'queryKey'>): WithRequired<OmitKeyof<UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, ProhibitedQueryOptionsKeyInV5>, 'queryKey'>;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=queryOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryOptions.esm.js","sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n WithRequired,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\ntype UseQueryOptionsOmitted<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'onSuccess' | 'onError' | 'onSettled' | 'refetchInterval'\n>\n\ntype ProhibitedQueryOptionsKeyInV5 = keyof Pick<\n UseQueryOptionsOmitted,\n 'useErrorBoundary' | 'suspense' | 'getNextPageParam' | 'getPreviousPageParam'\n>\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData?:\n | undefined\n | InitialDataFunction<NonUndefinedGuard<TQueryFnData>>\n | NonUndefinedGuard<TQueryFnData>\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData:\n | NonUndefinedGuard<TQueryFnData>\n | (() => NonUndefinedGuard<TQueryFnData>)\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryKey'\n>\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryKey'\n>\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"names":["queryOptions","options"],"mappings":"
|
|
1
|
+
{"version":3,"file":"queryOptions.esm.js","sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n WithRequired,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\ntype UseQueryOptionsOmitted<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'onSuccess' | 'onError' | 'onSettled' | 'refetchInterval'\n>\n\ntype ProhibitedQueryOptionsKeyInV5 = keyof Pick<\n UseQueryOptionsOmitted,\n 'useErrorBoundary' | 'suspense' | 'getNextPageParam' | 'getPreviousPageParam'\n>\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData?:\n | undefined\n | InitialDataFunction<NonUndefinedGuard<TQueryFnData>>\n | NonUndefinedGuard<TQueryFnData>\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData:\n | NonUndefinedGuard<TQueryFnData>\n | (() => NonUndefinedGuard<TQueryFnData>)\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n OmitKeyof<\n DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n>\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n OmitKeyof<\n UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n>\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"names":["queryOptions","options"],"mappings":"AAyFO,SAASA,YAAT,CAAsBC,OAAtB,EAAwC;AAC7C,EAAA,OAAOA,OAAP,CAAA;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryOptions.js","sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n WithRequired,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\ntype UseQueryOptionsOmitted<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'onSuccess' | 'onError' | 'onSettled' | 'refetchInterval'\n>\n\ntype ProhibitedQueryOptionsKeyInV5 = keyof Pick<\n UseQueryOptionsOmitted,\n 'useErrorBoundary' | 'suspense' | 'getNextPageParam' | 'getPreviousPageParam'\n>\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData?:\n | undefined\n | InitialDataFunction<NonUndefinedGuard<TQueryFnData>>\n | NonUndefinedGuard<TQueryFnData>\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData:\n | NonUndefinedGuard<TQueryFnData>\n | (() => NonUndefinedGuard<TQueryFnData>)\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryKey'\n>\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryKey'\n>\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"names":["queryOptions","options"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"queryOptions.js","sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n WithRequired,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\ntype UseQueryOptionsOmitted<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'onSuccess' | 'onError' | 'onSettled' | 'refetchInterval'\n>\n\ntype ProhibitedQueryOptionsKeyInV5 = keyof Pick<\n UseQueryOptionsOmitted,\n 'useErrorBoundary' | 'suspense' | 'getNextPageParam' | 'getPreviousPageParam'\n>\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData?:\n | undefined\n | InitialDataFunction<NonUndefinedGuard<TQueryFnData>>\n | NonUndefinedGuard<TQueryFnData>\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData:\n | NonUndefinedGuard<TQueryFnData>\n | (() => NonUndefinedGuard<TQueryFnData>)\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n OmitKeyof<\n DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n>\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n OmitKeyof<\n UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n>\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"names":["queryOptions","options"],"mappings":";;;;AAyFO,SAASA,YAAT,CAAsBC,OAAtB,EAAwC;AAC7C,EAAA,OAAOA,OAAP,CAAA;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryOptions.mjs","sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n WithRequired,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\ntype UseQueryOptionsOmitted<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'onSuccess' | 'onError' | 'onSettled' | 'refetchInterval'\n>\n\ntype ProhibitedQueryOptionsKeyInV5 = keyof Pick<\n UseQueryOptionsOmitted,\n 'useErrorBoundary' | 'suspense' | 'getNextPageParam' | 'getPreviousPageParam'\n>\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData?:\n | undefined\n | InitialDataFunction<NonUndefinedGuard<TQueryFnData>>\n | NonUndefinedGuard<TQueryFnData>\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData:\n | NonUndefinedGuard<TQueryFnData>\n | (() => NonUndefinedGuard<TQueryFnData>)\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryKey'\n>\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'queryKey'\n>\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"names":["queryOptions","options"],"mappings":"
|
|
1
|
+
{"version":3,"file":"queryOptions.mjs","sources":["../../src/queryOptions.ts"],"sourcesContent":["import type {\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n WithRequired,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\ntype UseQueryOptionsOmitted<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n 'onSuccess' | 'onError' | 'onSettled' | 'refetchInterval'\n>\n\ntype ProhibitedQueryOptionsKeyInV5 = keyof Pick<\n UseQueryOptionsOmitted,\n 'useErrorBoundary' | 'suspense' | 'getNextPageParam' | 'getPreviousPageParam'\n>\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData?:\n | undefined\n | InitialDataFunction<NonUndefinedGuard<TQueryFnData>>\n | NonUndefinedGuard<TQueryFnData>\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptionsOmitted<TQueryFnData, TError, TData, TQueryKey> & {\n initialData:\n | NonUndefinedGuard<TQueryFnData>\n | (() => NonUndefinedGuard<TQueryFnData>)\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n OmitKeyof<\n DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n>\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: WithRequired<\n OmitKeyof<\n UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n >,\n): WithRequired<\n OmitKeyof<\n UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>,\n ProhibitedQueryOptionsKeyInV5\n >,\n 'queryKey'\n>\n\nexport function queryOptions(options: unknown) {\n return options\n}\n"],"names":["queryOptions","options"],"mappings":"AAyFO,SAASA,YAAT,CAAsBC,OAAtB,EAAwC;AAC7C,EAAA,OAAOA,OAAP,CAAA;AACD;;;;"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ensures minimum staleTime and cacheTime values when suspense is enabled.
|
|
3
|
+
* Despite the name, this function guards both staleTime and cacheTime to prevent
|
|
4
|
+
* infinite re-render loops with synchronous queries.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated in v5 - replaced by ensureSuspenseTimers
|
|
7
|
+
*/
|
|
1
8
|
const ensureStaleTime = defaultedOptions => {
|
|
2
9
|
if (defaultedOptions.suspense) {
|
|
3
10
|
// Always set stale time when using suspense to prevent
|
|
@@ -5,6 +12,10 @@ const ensureStaleTime = defaultedOptions => {
|
|
|
5
12
|
if (typeof defaultedOptions.staleTime !== 'number') {
|
|
6
13
|
defaultedOptions.staleTime = 1000;
|
|
7
14
|
}
|
|
15
|
+
|
|
16
|
+
if (typeof defaultedOptions.cacheTime === 'number') {
|
|
17
|
+
defaultedOptions.cacheTime = Math.max(defaultedOptions.cacheTime, 1000);
|
|
18
|
+
}
|
|
8
19
|
}
|
|
9
20
|
};
|
|
10
21
|
const willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suspense.esm.js","sources":["../../src/suspense.ts"],"sourcesContent":["import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'\nimport type { QueryObserver } from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport type { QueryObserverResult } from '@tanstack/query-core'\nimport type { QueryKey } from '@tanstack/query-core'\n\nexport const ensureStaleTime = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\n) => {\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (typeof defaultedOptions.staleTime !== 'number') {\n defaultedOptions.staleTime = 1000\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions<any, any, any, any, any>\n | undefined,\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => defaultedOptions?.suspense && willFetch(result, isRestoring)\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer\n .fetchOptimistic(defaultedOptions)\n .then(({ data }) => {\n defaultedOptions.onSuccess?.(data as TData)\n defaultedOptions.onSettled?.(data, null)\n })\n .catch((error) => {\n errorResetBoundary.clearReset()\n defaultedOptions.onError?.(error)\n defaultedOptions.onSettled?.(undefined, error)\n })\n"],"names":["ensureStaleTime","defaultedOptions","suspense","staleTime","willFetch","result","isRestoring","isLoading","isFetching","shouldSuspend","fetchOptimistic","observer","errorResetBoundary","then","data","onSuccess","onSettled","catch","error","clearReset","onError","undefined"],"mappings":"
|
|
1
|
+
{"version":3,"file":"suspense.esm.js","sources":["../../src/suspense.ts"],"sourcesContent":["import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'\nimport type { QueryObserver } from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport type { QueryObserverResult } from '@tanstack/query-core'\nimport type { QueryKey } from '@tanstack/query-core'\n\n/**\n * Ensures minimum staleTime and cacheTime values when suspense is enabled.\n * Despite the name, this function guards both staleTime and cacheTime to prevent\n * infinite re-render loops with synchronous queries.\n *\n * @deprecated in v5 - replaced by ensureSuspenseTimers\n */\nexport const ensureStaleTime = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\n) => {\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (typeof defaultedOptions.staleTime !== 'number') {\n defaultedOptions.staleTime = 1000\n }\n\n if (typeof defaultedOptions.cacheTime === 'number') {\n defaultedOptions.cacheTime = Math.max(defaultedOptions.cacheTime, 1000)\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions<any, any, any, any, any>\n | undefined,\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => defaultedOptions?.suspense && willFetch(result, isRestoring)\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer\n .fetchOptimistic(defaultedOptions)\n .then(({ data }) => {\n defaultedOptions.onSuccess?.(data as TData)\n defaultedOptions.onSettled?.(data, null)\n })\n .catch((error) => {\n errorResetBoundary.clearReset()\n defaultedOptions.onError?.(error)\n defaultedOptions.onSettled?.(undefined, error)\n })\n"],"names":["ensureStaleTime","defaultedOptions","suspense","staleTime","cacheTime","Math","max","willFetch","result","isRestoring","isLoading","isFetching","shouldSuspend","fetchOptimistic","observer","errorResetBoundary","then","data","onSuccess","onSettled","catch","error","clearReset","onError","undefined"],"mappings":"AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACaA,MAAAA,eAAe,GAC1BC,gBAD6B,IAE1B;EACH,IAAIA,gBAAgB,CAACC,QAArB,EAA+B;AAC7B;AACA;AACA,IAAA,IAAI,OAAOD,gBAAgB,CAACE,SAAxB,KAAsC,QAA1C,EAAoD;MAClDF,gBAAgB,CAACE,SAAjB,GAA6B,IAA7B,CAAA;AACD,KAAA;;AAED,IAAA,IAAI,OAAOF,gBAAgB,CAACG,SAAxB,KAAsC,QAA1C,EAAoD;AAClDH,MAAAA,gBAAgB,CAACG,SAAjB,GAA6BC,IAAI,CAACC,GAAL,CAASL,gBAAgB,CAACG,SAA1B,EAAqC,IAArC,CAA7B,CAAA;AACD,KAAA;AACF,GAAA;AACF,EAdM;MAgBMG,SAAS,GAAG,CACvBC,MADuB,EAEvBC,WAFuB,KAGpBD,MAAM,CAACE,SAAP,IAAoBF,MAAM,CAACG,UAA3B,IAAyC,CAACF,YAHxC;AAKA,MAAMG,aAAa,GAAG,CAC3BX,gBAD2B,EAI3BO,MAJ2B,EAK3BC,WAL2B,KAMxB,CAAAR,gBAAgB,IAAhB,IAAA,GAAA,KAAA,CAAA,GAAAA,gBAAgB,CAAEC,QAAlB,KAA8BK,SAAS,CAACC,MAAD,EAASC,WAAT,EANrC;MAQMI,eAAe,GAAG,CAO7BZ,gBAP6B,EAc7Ba,QAd6B,EAe7BC,kBAf6B,KAiB7BD,QAAQ,CACLD,eADH,CACmBZ,gBADnB,CAEGe,CAAAA,IAFH,CAEQ,CAAC;AAAEC,EAAAA,IAAAA;AAAF,CAAD,KAAc;AAClBhB,EAAAA,gBAAgB,CAACiB,SAAjB,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAjB,gBAAgB,CAACiB,SAAjB,CAA6BD,IAA7B,CAAA,CAAA;EACAhB,gBAAgB,CAACkB,SAAjB,IAAAlB,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,gBAAgB,CAACkB,SAAjB,CAA6BF,IAA7B,EAAmC,IAAnC,CAAA,CAAA;AACD,CALH,CAMGG,CAAAA,KANH,CAMUC,KAAD,IAAW;AAChBN,EAAAA,kBAAkB,CAACO,UAAnB,EAAA,CAAA;AACArB,EAAAA,gBAAgB,CAACsB,OAAjB,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAtB,gBAAgB,CAACsB,OAAjB,CAA2BF,KAA3B,CAAA,CAAA;EACApB,gBAAgB,CAACkB,SAAjB,IAAAlB,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,gBAAgB,CAACkB,SAAjB,CAA6BK,SAA7B,EAAwCH,KAAxC,CAAA,CAAA;AACD,CAVH;;;;"}
|
package/build/lib/suspense.js
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Ensures minimum staleTime and cacheTime values when suspense is enabled.
|
|
7
|
+
* Despite the name, this function guards both staleTime and cacheTime to prevent
|
|
8
|
+
* infinite re-render loops with synchronous queries.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated in v5 - replaced by ensureSuspenseTimers
|
|
11
|
+
*/
|
|
5
12
|
const ensureStaleTime = defaultedOptions => {
|
|
6
13
|
if (defaultedOptions.suspense) {
|
|
7
14
|
// Always set stale time when using suspense to prevent
|
|
@@ -9,6 +16,10 @@ const ensureStaleTime = defaultedOptions => {
|
|
|
9
16
|
if (typeof defaultedOptions.staleTime !== 'number') {
|
|
10
17
|
defaultedOptions.staleTime = 1000;
|
|
11
18
|
}
|
|
19
|
+
|
|
20
|
+
if (typeof defaultedOptions.cacheTime === 'number') {
|
|
21
|
+
defaultedOptions.cacheTime = Math.max(defaultedOptions.cacheTime, 1000);
|
|
22
|
+
}
|
|
12
23
|
}
|
|
13
24
|
};
|
|
14
25
|
const willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suspense.js","sources":["../../src/suspense.ts"],"sourcesContent":["import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'\nimport type { QueryObserver } from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport type { QueryObserverResult } from '@tanstack/query-core'\nimport type { QueryKey } from '@tanstack/query-core'\n\nexport const ensureStaleTime = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\n) => {\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (typeof defaultedOptions.staleTime !== 'number') {\n defaultedOptions.staleTime = 1000\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions<any, any, any, any, any>\n | undefined,\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => defaultedOptions?.suspense && willFetch(result, isRestoring)\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer\n .fetchOptimistic(defaultedOptions)\n .then(({ data }) => {\n defaultedOptions.onSuccess?.(data as TData)\n defaultedOptions.onSettled?.(data, null)\n })\n .catch((error) => {\n errorResetBoundary.clearReset()\n defaultedOptions.onError?.(error)\n defaultedOptions.onSettled?.(undefined, error)\n })\n"],"names":["ensureStaleTime","defaultedOptions","suspense","staleTime","willFetch","result","isRestoring","isLoading","isFetching","shouldSuspend","fetchOptimistic","observer","errorResetBoundary","then","data","onSuccess","onSettled","catch","error","clearReset","onError","undefined"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"suspense.js","sources":["../../src/suspense.ts"],"sourcesContent":["import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'\nimport type { QueryObserver } from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport type { QueryObserverResult } from '@tanstack/query-core'\nimport type { QueryKey } from '@tanstack/query-core'\n\n/**\n * Ensures minimum staleTime and cacheTime values when suspense is enabled.\n * Despite the name, this function guards both staleTime and cacheTime to prevent\n * infinite re-render loops with synchronous queries.\n *\n * @deprecated in v5 - replaced by ensureSuspenseTimers\n */\nexport const ensureStaleTime = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\n) => {\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (typeof defaultedOptions.staleTime !== 'number') {\n defaultedOptions.staleTime = 1000\n }\n\n if (typeof defaultedOptions.cacheTime === 'number') {\n defaultedOptions.cacheTime = Math.max(defaultedOptions.cacheTime, 1000)\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions<any, any, any, any, any>\n | undefined,\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => defaultedOptions?.suspense && willFetch(result, isRestoring)\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer\n .fetchOptimistic(defaultedOptions)\n .then(({ data }) => {\n defaultedOptions.onSuccess?.(data as TData)\n defaultedOptions.onSettled?.(data, null)\n })\n .catch((error) => {\n errorResetBoundary.clearReset()\n defaultedOptions.onError?.(error)\n defaultedOptions.onSettled?.(undefined, error)\n })\n"],"names":["ensureStaleTime","defaultedOptions","suspense","staleTime","cacheTime","Math","max","willFetch","result","isRestoring","isLoading","isFetching","shouldSuspend","fetchOptimistic","observer","errorResetBoundary","then","data","onSuccess","onSettled","catch","error","clearReset","onError","undefined"],"mappings":";;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACaA,MAAAA,eAAe,GAC1BC,gBAD6B,IAE1B;EACH,IAAIA,gBAAgB,CAACC,QAArB,EAA+B;AAC7B;AACA;AACA,IAAA,IAAI,OAAOD,gBAAgB,CAACE,SAAxB,KAAsC,QAA1C,EAAoD;MAClDF,gBAAgB,CAACE,SAAjB,GAA6B,IAA7B,CAAA;AACD,KAAA;;AAED,IAAA,IAAI,OAAOF,gBAAgB,CAACG,SAAxB,KAAsC,QAA1C,EAAoD;AAClDH,MAAAA,gBAAgB,CAACG,SAAjB,GAA6BC,IAAI,CAACC,GAAL,CAASL,gBAAgB,CAACG,SAA1B,EAAqC,IAArC,CAA7B,CAAA;AACD,KAAA;AACF,GAAA;AACF,EAdM;MAgBMG,SAAS,GAAG,CACvBC,MADuB,EAEvBC,WAFuB,KAGpBD,MAAM,CAACE,SAAP,IAAoBF,MAAM,CAACG,UAA3B,IAAyC,CAACF,YAHxC;AAKA,MAAMG,aAAa,GAAG,CAC3BX,gBAD2B,EAI3BO,MAJ2B,EAK3BC,WAL2B,KAMxB,CAAAR,gBAAgB,IAAhB,IAAA,GAAA,KAAA,CAAA,GAAAA,gBAAgB,CAAEC,QAAlB,KAA8BK,SAAS,CAACC,MAAD,EAASC,WAAT,EANrC;MAQMI,eAAe,GAAG,CAO7BZ,gBAP6B,EAc7Ba,QAd6B,EAe7BC,kBAf6B,KAiB7BD,QAAQ,CACLD,eADH,CACmBZ,gBADnB,CAEGe,CAAAA,IAFH,CAEQ,CAAC;AAAEC,EAAAA,IAAAA;AAAF,CAAD,KAAc;AAClBhB,EAAAA,gBAAgB,CAACiB,SAAjB,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAjB,gBAAgB,CAACiB,SAAjB,CAA6BD,IAA7B,CAAA,CAAA;EACAhB,gBAAgB,CAACkB,SAAjB,IAAAlB,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,gBAAgB,CAACkB,SAAjB,CAA6BF,IAA7B,EAAmC,IAAnC,CAAA,CAAA;AACD,CALH,CAMGG,CAAAA,KANH,CAMUC,KAAD,IAAW;AAChBN,EAAAA,kBAAkB,CAACO,UAAnB,EAAA,CAAA;AACArB,EAAAA,gBAAgB,CAACsB,OAAjB,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAtB,gBAAgB,CAACsB,OAAjB,CAA2BF,KAA3B,CAAA,CAAA;EACApB,gBAAgB,CAACkB,SAAjB,IAAAlB,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,gBAAgB,CAACkB,SAAjB,CAA6BK,SAA7B,EAAwCH,KAAxC,CAAA,CAAA;AACD,CAVH;;;;;;;"}
|
package/build/lib/suspense.mjs
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ensures minimum staleTime and cacheTime values when suspense is enabled.
|
|
3
|
+
* Despite the name, this function guards both staleTime and cacheTime to prevent
|
|
4
|
+
* infinite re-render loops with synchronous queries.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated in v5 - replaced by ensureSuspenseTimers
|
|
7
|
+
*/
|
|
1
8
|
const ensureStaleTime = defaultedOptions => {
|
|
2
9
|
if (defaultedOptions.suspense) {
|
|
3
10
|
// Always set stale time when using suspense to prevent
|
|
@@ -5,6 +12,10 @@ const ensureStaleTime = defaultedOptions => {
|
|
|
5
12
|
if (typeof defaultedOptions.staleTime !== 'number') {
|
|
6
13
|
defaultedOptions.staleTime = 1000;
|
|
7
14
|
}
|
|
15
|
+
|
|
16
|
+
if (typeof defaultedOptions.cacheTime === 'number') {
|
|
17
|
+
defaultedOptions.cacheTime = Math.max(defaultedOptions.cacheTime, 1000);
|
|
18
|
+
}
|
|
8
19
|
}
|
|
9
20
|
};
|
|
10
21
|
const willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suspense.mjs","sources":["../../src/suspense.ts"],"sourcesContent":["import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'\nimport type { QueryObserver } from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport type { QueryObserverResult } from '@tanstack/query-core'\nimport type { QueryKey } from '@tanstack/query-core'\n\nexport const ensureStaleTime = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\n) => {\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (typeof defaultedOptions.staleTime !== 'number') {\n defaultedOptions.staleTime = 1000\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions<any, any, any, any, any>\n | undefined,\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => defaultedOptions?.suspense && willFetch(result, isRestoring)\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer\n .fetchOptimistic(defaultedOptions)\n .then(({ data }) => {\n defaultedOptions.onSuccess?.(data as TData)\n defaultedOptions.onSettled?.(data, null)\n })\n .catch((error) => {\n errorResetBoundary.clearReset()\n defaultedOptions.onError?.(error)\n defaultedOptions.onSettled?.(undefined, error)\n })\n"],"names":["ensureStaleTime","defaultedOptions","suspense","staleTime","willFetch","result","isRestoring","isLoading","isFetching","shouldSuspend","fetchOptimistic","observer","errorResetBoundary","then","data","onSuccess","onSettled","catch","error","clearReset","onError","undefined"],"mappings":"
|
|
1
|
+
{"version":3,"file":"suspense.mjs","sources":["../../src/suspense.ts"],"sourcesContent":["import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'\nimport type { QueryObserver } from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\nimport type { QueryObserverResult } from '@tanstack/query-core'\nimport type { QueryKey } from '@tanstack/query-core'\n\n/**\n * Ensures minimum staleTime and cacheTime values when suspense is enabled.\n * Despite the name, this function guards both staleTime and cacheTime to prevent\n * infinite re-render loops with synchronous queries.\n *\n * @deprecated in v5 - replaced by ensureSuspenseTimers\n */\nexport const ensureStaleTime = (\n defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,\n) => {\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (typeof defaultedOptions.staleTime !== 'number') {\n defaultedOptions.staleTime = 1000\n }\n\n if (typeof defaultedOptions.cacheTime === 'number') {\n defaultedOptions.cacheTime = Math.max(defaultedOptions.cacheTime, 1000)\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions<any, any, any, any, any>\n | undefined,\n result: QueryObserverResult<any, any>,\n isRestoring: boolean,\n) => defaultedOptions?.suspense && willFetch(result, isRestoring)\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver<TQueryFnData, TError, TData, TQueryData, TQueryKey>,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer\n .fetchOptimistic(defaultedOptions)\n .then(({ data }) => {\n defaultedOptions.onSuccess?.(data as TData)\n defaultedOptions.onSettled?.(data, null)\n })\n .catch((error) => {\n errorResetBoundary.clearReset()\n defaultedOptions.onError?.(error)\n defaultedOptions.onSettled?.(undefined, error)\n })\n"],"names":["ensureStaleTime","defaultedOptions","suspense","staleTime","cacheTime","Math","max","willFetch","result","isRestoring","isLoading","isFetching","shouldSuspend","fetchOptimistic","observer","errorResetBoundary","then","data","onSuccess","onSettled","catch","error","clearReset","onError","undefined"],"mappings":"AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACaA,MAAAA,eAAe,GAC1BC,gBAD6B,IAE1B;EACH,IAAIA,gBAAgB,CAACC,QAArB,EAA+B;AAC7B;AACA;AACA,IAAA,IAAI,OAAOD,gBAAgB,CAACE,SAAxB,KAAsC,QAA1C,EAAoD;MAClDF,gBAAgB,CAACE,SAAjB,GAA6B,IAA7B,CAAA;AACD,KAAA;;AAED,IAAA,IAAI,OAAOF,gBAAgB,CAACG,SAAxB,KAAsC,QAA1C,EAAoD;AAClDH,MAAAA,gBAAgB,CAACG,SAAjB,GAA6BC,IAAI,CAACC,GAAL,CAASL,gBAAgB,CAACG,SAA1B,EAAqC,IAArC,CAA7B,CAAA;AACD,KAAA;AACF,GAAA;AACF,EAdM;MAgBMG,SAAS,GAAG,CACvBC,MADuB,EAEvBC,WAFuB,KAGpBD,MAAM,CAACE,SAAP,IAAoBF,MAAM,CAACG,UAA3B,IAAyC,CAACF,YAHxC;AAKA,MAAMG,aAAa,GAAG,CAC3BX,gBAD2B,EAI3BO,MAJ2B,EAK3BC,WAL2B,KAMxB,CAAAR,gBAAgB,IAAhB,IAAA,GAAA,KAAA,CAAA,GAAAA,gBAAgB,CAAEC,QAAlB,KAA8BK,SAAS,CAACC,MAAD,EAASC,WAAT,EANrC;MAQMI,eAAe,GAAG,CAO7BZ,gBAP6B,EAc7Ba,QAd6B,EAe7BC,kBAf6B,KAiB7BD,QAAQ,CACLD,eADH,CACmBZ,gBADnB,CAEGe,CAAAA,IAFH,CAEQ,CAAC;AAAEC,EAAAA,IAAAA;AAAF,CAAD,KAAc;AAClBhB,EAAAA,gBAAgB,CAACiB,SAAjB,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAjB,gBAAgB,CAACiB,SAAjB,CAA6BD,IAA7B,CAAA,CAAA;EACAhB,gBAAgB,CAACkB,SAAjB,IAAAlB,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,gBAAgB,CAACkB,SAAjB,CAA6BF,IAA7B,EAAmC,IAAnC,CAAA,CAAA;AACD,CALH,CAMGG,CAAAA,KANH,CAMUC,KAAD,IAAW;AAChBN,EAAAA,kBAAkB,CAACO,UAAnB,EAAA,CAAA;AACArB,EAAAA,gBAAgB,CAACsB,OAAjB,IAAA,IAAA,GAAA,KAAA,CAAA,GAAAtB,gBAAgB,CAACsB,OAAjB,CAA2BF,KAA3B,CAAA,CAAA;EACApB,gBAAgB,CAACkB,SAAjB,IAAAlB,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,gBAAgB,CAACkB,SAAjB,CAA6BK,SAA7B,EAAwCH,KAAxC,CAAA,CAAA;AACD,CAVH;;;;"}
|
package/build/lib/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
|
-
import type { DefinedQueryObserverResult, DistributiveOmit, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, MutateFunction, MutationObserverOptions, MutationObserverResult, OmitKeyof, QueryKey, QueryObserverOptions, QueryObserverResult } from '@tanstack/query-core';
|
|
2
|
+
import type { DefinedInfiniteQueryObserverResult, DefinedQueryObserverResult, DistributiveOmit, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, MutateFunction, MutationObserverOptions, MutationObserverResult, OmitKeyof, QueryKey, QueryObserverOptions, QueryObserverResult } from '@tanstack/query-core';
|
|
3
3
|
import type { QueryClient } from '@tanstack/query-core';
|
|
4
4
|
export interface ContextOptions {
|
|
5
5
|
/**
|
|
@@ -27,6 +27,8 @@ export declare type UseSuspenseQueryResult<TData = unknown, TError = unknown> =
|
|
|
27
27
|
export declare type DefinedUseBaseQueryResult<TData = unknown, TError = unknown> = DefinedQueryObserverResult<TData, TError>;
|
|
28
28
|
export declare type DefinedUseQueryResult<TData = unknown, TError = unknown> = DefinedUseBaseQueryResult<TData, TError>;
|
|
29
29
|
export declare type UseInfiniteQueryResult<TData = unknown, TError = unknown> = InfiniteQueryObserverResult<TData, TError>;
|
|
30
|
+
export declare type DefinedUseInfiniteQueryResult<TData = unknown, TError = unknown> = DefinedInfiniteQueryObserverResult<TData, TError>;
|
|
31
|
+
export declare type UseSuspenseInfiniteQueryResult<TData = unknown, TError = unknown> = OmitKeyof<DefinedInfiniteQueryObserverResult<TData, TError>, 'isPlaceholderData'>;
|
|
30
32
|
export interface UseMutationOptions<TData = unknown, TError = unknown, TVariables = void, TContext = unknown> extends ContextOptions, Omit<MutationObserverOptions<TData, TError, TVariables, TContext>, '_defaulted' | 'variables'> {
|
|
31
33
|
}
|
|
32
34
|
export declare type UseMutateFunction<TData = unknown, TError = unknown, TVariables = void, TContext = unknown> = (...args: Parameters<MutateFunction<TData, TError, TVariables, TContext>>) => void;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import type { QueryFunction, QueryKey } from '@tanstack/query-core';
|
|
2
|
-
import type { UseInfiniteQueryOptions, UseInfiniteQueryResult } from './types';
|
|
1
|
+
import type { InfiniteData, NonUndefinedGuard, QueryFunction, QueryKey } from '@tanstack/query-core';
|
|
2
|
+
import type { DefinedUseInfiniteQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult } from './types';
|
|
3
|
+
export declare function useInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey> & {
|
|
4
|
+
initialData: NonUndefinedGuard<InfiniteData<TQueryFnData>> | (() => NonUndefinedGuard<InfiniteData<TQueryFnData>>) | undefined;
|
|
5
|
+
}): DefinedUseInfiniteQueryResult<TData, TError>;
|
|
3
6
|
export declare function useInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>): UseInfiniteQueryResult<TData, TError>;
|
|
7
|
+
/** @deprecated This function overload will be removed in the next major version. */
|
|
4
8
|
export declare function useInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: Omit<UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>, 'queryKey'>): UseInfiniteQueryResult<TData, TError>;
|
|
9
|
+
/** @deprecated This function overload will be removed in the next major version. */
|
|
5
10
|
export declare function useInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, queryFn: QueryFunction<TQueryFnData, TQueryKey>, options?: Omit<UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>, 'queryKey' | 'queryFn'>): UseInfiniteQueryResult<TData, TError>;
|
|
6
11
|
//# sourceMappingURL=useInfiniteQuery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInfiniteQuery.esm.js","sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, parseQueryArgs } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n QueryFunction,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {
|
|
1
|
+
{"version":3,"file":"useInfiniteQuery.esm.js","sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, parseQueryArgs } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n InfiniteData,\n NonUndefinedGuard,\n QueryFunction,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\n\n// HOOK\n\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n > & {\n initialData:\n | NonUndefinedGuard<InfiniteData<TQueryFnData>>\n | (() => NonUndefinedGuard<InfiniteData<TQueryFnData>>)\n | undefined\n },\n): DefinedUseInfiniteQueryResult<TData, TError>\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n): UseInfiniteQueryResult<TData, TError>\n/** @deprecated This function overload will be removed in the next major version. */\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n options?: Omit<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n 'queryKey'\n >,\n): UseInfiniteQueryResult<TData, TError>\n/** @deprecated This function overload will be removed in the next major version. */\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n queryFn: QueryFunction<TQueryFnData, TQueryKey>,\n options?: Omit<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n 'queryKey' | 'queryFn'\n >,\n): UseInfiniteQueryResult<TData, TError>\nexport function useInfiniteQuery<\n TQueryFnData,\n TError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n arg1:\n | TQueryKey\n | UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n arg2?:\n | QueryFunction<TQueryFnData, TQueryKey>\n | UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n arg3?: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n): UseInfiniteQueryResult<TData, TError> {\n const options = parseQueryArgs(arg1, arg2, arg3)\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n ) as UseInfiniteQueryResult<TData, TError>\n}\n"],"names":[],"mappings":";;;;AA0FO;;AAiCL;AAID;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInfiniteQuery.js","sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, parseQueryArgs } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n QueryFunction,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {
|
|
1
|
+
{"version":3,"file":"useInfiniteQuery.js","sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, parseQueryArgs } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n InfiniteData,\n NonUndefinedGuard,\n QueryFunction,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\n\n// HOOK\n\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n > & {\n initialData:\n | NonUndefinedGuard<InfiniteData<TQueryFnData>>\n | (() => NonUndefinedGuard<InfiniteData<TQueryFnData>>)\n | undefined\n },\n): DefinedUseInfiniteQueryResult<TData, TError>\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n): UseInfiniteQueryResult<TData, TError>\n/** @deprecated This function overload will be removed in the next major version. */\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n options?: Omit<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n 'queryKey'\n >,\n): UseInfiniteQueryResult<TData, TError>\n/** @deprecated This function overload will be removed in the next major version. */\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n queryFn: QueryFunction<TQueryFnData, TQueryKey>,\n options?: Omit<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n 'queryKey' | 'queryFn'\n >,\n): UseInfiniteQueryResult<TData, TError>\nexport function useInfiniteQuery<\n TQueryFnData,\n TError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n arg1:\n | TQueryKey\n | UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n arg2?:\n | QueryFunction<TQueryFnData, TQueryKey>\n | UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n arg3?: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n): UseInfiniteQueryResult<TData, TError> {\n const options = parseQueryArgs(arg1, arg2, arg3)\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n ) as UseInfiniteQueryResult<TData, TError>\n}\n"],"names":[],"mappings":";;;;;;;;AA0FO;;AAiCL;AAID;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInfiniteQuery.mjs","sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, parseQueryArgs } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n QueryFunction,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {
|
|
1
|
+
{"version":3,"file":"useInfiniteQuery.mjs","sources":["../../src/useInfiniteQuery.ts"],"sourcesContent":["'use client'\nimport { InfiniteQueryObserver, parseQueryArgs } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n InfiniteData,\n NonUndefinedGuard,\n QueryFunction,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\n\n// HOOK\n\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n > & {\n initialData:\n | NonUndefinedGuard<InfiniteData<TQueryFnData>>\n | (() => NonUndefinedGuard<InfiniteData<TQueryFnData>>)\n | undefined\n },\n): DefinedUseInfiniteQueryResult<TData, TError>\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n): UseInfiniteQueryResult<TData, TError>\n/** @deprecated This function overload will be removed in the next major version. */\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n options?: Omit<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n 'queryKey'\n >,\n): UseInfiniteQueryResult<TData, TError>\n/** @deprecated This function overload will be removed in the next major version. */\nexport function useInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n queryKey: TQueryKey,\n queryFn: QueryFunction<TQueryFnData, TQueryKey>,\n options?: Omit<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n 'queryKey' | 'queryFn'\n >,\n): UseInfiniteQueryResult<TData, TError>\nexport function useInfiniteQuery<\n TQueryFnData,\n TError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n arg1:\n | TQueryKey\n | UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n arg2?:\n | QueryFunction<TQueryFnData, TQueryKey>\n | UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n arg3?: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey\n >,\n): UseInfiniteQueryResult<TData, TError> {\n const options = parseQueryArgs(arg1, arg2, arg3)\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n ) as UseInfiniteQueryResult<TData, TError>\n}\n"],"names":[],"mappings":";;;;AA0FO;;AAiCL;AAID;;"}
|