@tanstack/react-query 5.0.0-alpha.88 → 5.0.0-alpha.90
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/codemods/rename-hydrate/rename-hydrate.js +55 -0
- package/build/codemods/rename-properties/rename-properties.js +41 -0
- package/build/legacy/HydrationBoundary.cjs +4 -2
- package/build/legacy/HydrationBoundary.cjs.map +1 -1
- package/build/legacy/HydrationBoundary.js +4 -2
- package/build/legacy/HydrationBoundary.js.map +1 -1
- package/build/legacy/QueryClientProvider.cjs +5 -3
- package/build/legacy/QueryClientProvider.cjs.map +1 -1
- package/build/legacy/QueryClientProvider.js +5 -3
- package/build/legacy/QueryClientProvider.js.map +1 -1
- package/build/legacy/QueryErrorResetBoundary.cjs +5 -3
- package/build/legacy/QueryErrorResetBoundary.cjs.map +1 -1
- package/build/legacy/QueryErrorResetBoundary.js +5 -3
- package/build/legacy/QueryErrorResetBoundary.js.map +1 -1
- package/build/legacy/errorBoundaryUtils.cjs +6 -4
- package/build/legacy/errorBoundaryUtils.cjs.map +1 -1
- package/build/legacy/errorBoundaryUtils.js +6 -4
- package/build/legacy/errorBoundaryUtils.js.map +1 -1
- package/build/legacy/index.cjs +25 -14
- package/build/legacy/index.cjs.map +1 -1
- package/build/legacy/index.d.cts +4 -1
- package/build/legacy/index.d.ts +4 -1
- package/build/legacy/index.js +20 -13
- package/build/legacy/index.js.map +1 -1
- package/build/legacy/infiniteQueryOptions.cjs +33 -0
- package/build/legacy/infiniteQueryOptions.cjs.map +1 -0
- package/build/legacy/infiniteQueryOptions.d.cts +13 -0
- package/build/legacy/infiniteQueryOptions.d.ts +13 -0
- package/build/legacy/infiniteQueryOptions.js +8 -0
- package/build/legacy/infiniteQueryOptions.js.map +1 -0
- package/build/legacy/isRestoring.cjs +5 -3
- package/build/legacy/isRestoring.cjs.map +1 -1
- package/build/legacy/isRestoring.js +5 -3
- package/build/legacy/isRestoring.js.map +1 -1
- package/build/legacy/queryOptions.cjs +2 -0
- package/build/legacy/queryOptions.cjs.map +1 -1
- package/build/legacy/queryOptions.js +1 -0
- package/build/legacy/queryOptions.js.map +1 -1
- package/build/legacy/suspense.cjs +6 -4
- package/build/legacy/suspense.cjs.map +1 -1
- package/build/legacy/suspense.js +5 -4
- package/build/legacy/suspense.js.map +1 -1
- package/build/legacy/types.cjs +2 -0
- package/build/legacy/types.cjs.map +1 -1
- package/build/legacy/types.d.cts +10 -4
- package/build/legacy/types.d.ts +10 -4
- package/build/legacy/useBaseQuery.cjs +7 -5
- package/build/legacy/useBaseQuery.cjs.map +1 -1
- package/build/legacy/useBaseQuery.js +7 -5
- package/build/legacy/useBaseQuery.js.map +1 -1
- package/build/legacy/useInfiniteQuery.cjs +3 -1
- package/build/legacy/useInfiniteQuery.cjs.map +1 -1
- package/build/legacy/useInfiniteQuery.d.cts +4 -2
- package/build/legacy/useInfiniteQuery.d.ts +4 -2
- package/build/legacy/useInfiniteQuery.js +3 -1
- package/build/legacy/useInfiniteQuery.js.map +1 -1
- package/build/legacy/useIsFetching.cjs +3 -1
- package/build/legacy/useIsFetching.cjs.map +1 -1
- package/build/legacy/useIsFetching.js +3 -1
- package/build/legacy/useIsFetching.js.map +1 -1
- package/build/legacy/useMutation.cjs +4 -2
- package/build/legacy/useMutation.cjs.map +1 -1
- package/build/legacy/useMutation.js +4 -2
- package/build/legacy/useMutation.js.map +1 -1
- package/build/legacy/useMutationState.cjs +3 -1
- package/build/legacy/useMutationState.cjs.map +1 -1
- package/build/legacy/useMutationState.js +3 -1
- package/build/legacy/useMutationState.js.map +1 -1
- package/build/legacy/useQueries.cjs +7 -5
- package/build/legacy/useQueries.cjs.map +1 -1
- package/build/legacy/useQueries.js +7 -5
- package/build/legacy/useQueries.js.map +1 -1
- package/build/legacy/useQuery.cjs +3 -1
- package/build/legacy/useQuery.cjs.map +1 -1
- package/build/legacy/useQuery.js +3 -1
- package/build/legacy/useQuery.js.map +1 -1
- package/build/legacy/useSuspenseInfiniteQuery.cjs +46 -0
- package/build/legacy/useSuspenseInfiniteQuery.cjs.map +1 -0
- package/build/legacy/useSuspenseInfiniteQuery.d.cts +6 -0
- package/build/legacy/useSuspenseInfiniteQuery.d.ts +6 -0
- package/build/legacy/useSuspenseInfiniteQuery.js +22 -0
- package/build/legacy/useSuspenseInfiniteQuery.js.map +1 -0
- package/build/legacy/useSuspenseQuery.cjs +45 -0
- package/build/legacy/useSuspenseQuery.cjs.map +1 -0
- package/build/legacy/useSuspenseQuery.d.cts +6 -0
- package/build/legacy/useSuspenseQuery.d.ts +6 -0
- package/build/legacy/useSuspenseQuery.js +21 -0
- package/build/legacy/useSuspenseQuery.js.map +1 -0
- package/build/legacy/utils.cjs +2 -0
- package/build/legacy/utils.cjs.map +1 -1
- package/build/legacy/utils.js +1 -0
- package/build/legacy/utils.js.map +1 -1
- package/build/modern/HydrationBoundary.cjs +4 -2
- package/build/modern/HydrationBoundary.cjs.map +1 -1
- package/build/modern/HydrationBoundary.js +4 -2
- package/build/modern/HydrationBoundary.js.map +1 -1
- package/build/modern/QueryClientProvider.cjs +5 -3
- package/build/modern/QueryClientProvider.cjs.map +1 -1
- package/build/modern/QueryClientProvider.js +5 -3
- package/build/modern/QueryClientProvider.js.map +1 -1
- package/build/modern/QueryErrorResetBoundary.cjs +5 -3
- package/build/modern/QueryErrorResetBoundary.cjs.map +1 -1
- package/build/modern/QueryErrorResetBoundary.js +5 -3
- package/build/modern/QueryErrorResetBoundary.js.map +1 -1
- package/build/modern/errorBoundaryUtils.cjs +6 -4
- package/build/modern/errorBoundaryUtils.cjs.map +1 -1
- package/build/modern/errorBoundaryUtils.js +6 -4
- package/build/modern/errorBoundaryUtils.js.map +1 -1
- package/build/modern/index.cjs +25 -14
- package/build/modern/index.cjs.map +1 -1
- package/build/modern/index.d.cts +4 -1
- package/build/modern/index.d.ts +4 -1
- package/build/modern/index.js +20 -13
- package/build/modern/index.js.map +1 -1
- package/build/modern/infiniteQueryOptions.cjs +33 -0
- package/build/modern/infiniteQueryOptions.cjs.map +1 -0
- package/build/modern/infiniteQueryOptions.d.cts +13 -0
- package/build/modern/infiniteQueryOptions.d.ts +13 -0
- package/build/modern/infiniteQueryOptions.js +8 -0
- package/build/modern/infiniteQueryOptions.js.map +1 -0
- package/build/modern/isRestoring.cjs +5 -3
- package/build/modern/isRestoring.cjs.map +1 -1
- package/build/modern/isRestoring.js +5 -3
- package/build/modern/isRestoring.js.map +1 -1
- package/build/modern/queryOptions.cjs +2 -0
- package/build/modern/queryOptions.cjs.map +1 -1
- package/build/modern/queryOptions.js +1 -0
- package/build/modern/queryOptions.js.map +1 -1
- package/build/modern/suspense.cjs +6 -4
- package/build/modern/suspense.cjs.map +1 -1
- package/build/modern/suspense.js +5 -4
- package/build/modern/suspense.js.map +1 -1
- package/build/modern/types.cjs +2 -0
- package/build/modern/types.cjs.map +1 -1
- package/build/modern/types.d.cts +10 -4
- package/build/modern/types.d.ts +10 -4
- package/build/modern/useBaseQuery.cjs +7 -5
- package/build/modern/useBaseQuery.cjs.map +1 -1
- package/build/modern/useBaseQuery.js +7 -5
- package/build/modern/useBaseQuery.js.map +1 -1
- package/build/modern/useInfiniteQuery.cjs +3 -1
- package/build/modern/useInfiniteQuery.cjs.map +1 -1
- package/build/modern/useInfiniteQuery.d.cts +4 -2
- package/build/modern/useInfiniteQuery.d.ts +4 -2
- package/build/modern/useInfiniteQuery.js +3 -1
- package/build/modern/useInfiniteQuery.js.map +1 -1
- package/build/modern/useIsFetching.cjs +3 -1
- package/build/modern/useIsFetching.cjs.map +1 -1
- package/build/modern/useIsFetching.js +3 -1
- package/build/modern/useIsFetching.js.map +1 -1
- package/build/modern/useMutation.cjs +4 -2
- package/build/modern/useMutation.cjs.map +1 -1
- package/build/modern/useMutation.js +4 -2
- package/build/modern/useMutation.js.map +1 -1
- package/build/modern/useMutationState.cjs +3 -1
- package/build/modern/useMutationState.cjs.map +1 -1
- package/build/modern/useMutationState.js +3 -1
- package/build/modern/useMutationState.js.map +1 -1
- package/build/modern/useQueries.cjs +7 -5
- package/build/modern/useQueries.cjs.map +1 -1
- package/build/modern/useQueries.js +7 -5
- package/build/modern/useQueries.js.map +1 -1
- package/build/modern/useQuery.cjs +3 -1
- package/build/modern/useQuery.cjs.map +1 -1
- package/build/modern/useQuery.js +3 -1
- package/build/modern/useQuery.js.map +1 -1
- package/build/modern/useSuspenseInfiniteQuery.cjs +46 -0
- package/build/modern/useSuspenseInfiniteQuery.cjs.map +1 -0
- package/build/modern/useSuspenseInfiniteQuery.d.cts +6 -0
- package/build/modern/useSuspenseInfiniteQuery.d.ts +6 -0
- package/build/modern/useSuspenseInfiniteQuery.js +22 -0
- package/build/modern/useSuspenseInfiniteQuery.js.map +1 -0
- package/build/modern/useSuspenseQuery.cjs +45 -0
- package/build/modern/useSuspenseQuery.cjs.map +1 -0
- package/build/modern/useSuspenseQuery.d.cts +6 -0
- package/build/modern/useSuspenseQuery.d.ts +6 -0
- package/build/modern/useSuspenseQuery.js +21 -0
- package/build/modern/useSuspenseQuery.js.map +1 -0
- package/build/modern/utils.cjs +2 -0
- package/build/modern/utils.cjs.map +1 -1
- package/build/modern/utils.js +1 -0
- package/build/modern/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/useQuery.test.tsx +1 -4
- package/src/index.ts +3 -0
- package/src/infiniteQueryOptions.ts +93 -0
- package/src/types.ts +45 -3
- package/src/useInfiniteQuery.ts +45 -2
- package/src/useQuery.ts +0 -2
- package/src/useSuspenseInfiniteQuery.ts +47 -0
- package/src/useSuspenseQuery.ts +26 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
module.exports = (file, api) => {
|
|
2
|
+
const jscodeshift = api.jscodeshift
|
|
3
|
+
const root = jscodeshift(file.source)
|
|
4
|
+
|
|
5
|
+
const importSpecifiers = root
|
|
6
|
+
.find(jscodeshift.ImportDeclaration, {
|
|
7
|
+
source: {
|
|
8
|
+
value: '@tanstack/react-query',
|
|
9
|
+
},
|
|
10
|
+
})
|
|
11
|
+
.find(jscodeshift.ImportSpecifier, {
|
|
12
|
+
imported: {
|
|
13
|
+
name: 'Hydrate',
|
|
14
|
+
},
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
if (importSpecifiers.length > 0) {
|
|
18
|
+
const names = {
|
|
19
|
+
searched: 'Hydrate', // By default, we want to replace the `Hydrate` usages.
|
|
20
|
+
target: 'HydrationBoundary', // We want to replace them with `HydrationBoundary`.
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
importSpecifiers.replaceWith(({ node: mutableNode }) => {
|
|
24
|
+
/**
|
|
25
|
+
* When the local and imported names match which means the code doesn't contain import aliases, we need
|
|
26
|
+
* to replace only the import specifier.
|
|
27
|
+
* @type {boolean}
|
|
28
|
+
*/
|
|
29
|
+
const usesDefaultImport =
|
|
30
|
+
mutableNode.local.name === mutableNode.imported.name
|
|
31
|
+
|
|
32
|
+
if (!usesDefaultImport) {
|
|
33
|
+
// If the code uses import aliases, we must re-use the alias.
|
|
34
|
+
names.searched = mutableNode.local.name
|
|
35
|
+
names.target = mutableNode.local.name
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Override the import specifier.
|
|
39
|
+
mutableNode.imported.name = 'HydrationBoundary'
|
|
40
|
+
|
|
41
|
+
return mutableNode
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
root
|
|
45
|
+
.findJSXElements(names.searched)
|
|
46
|
+
.replaceWith(({ node: mutableNode }) => {
|
|
47
|
+
mutableNode.openingElement.name.name = names.target
|
|
48
|
+
mutableNode.closingElement.name.name = names.target
|
|
49
|
+
|
|
50
|
+
return mutableNode
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return root.toSource({ quote: 'single', lineTerminator: '\n' })
|
|
55
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
module.exports = (file, api) => {
|
|
2
|
+
const jscodeshift = api.jscodeshift
|
|
3
|
+
const root = jscodeshift(file.source)
|
|
4
|
+
|
|
5
|
+
const baseRenameLogic = (kind, from, to) => {
|
|
6
|
+
root
|
|
7
|
+
.find(kind, (node) => {
|
|
8
|
+
return (
|
|
9
|
+
node.computed === false &&
|
|
10
|
+
(node.key?.name === from || node.key?.value === from)
|
|
11
|
+
)
|
|
12
|
+
})
|
|
13
|
+
.replaceWith(({ node: mutableNode }) => {
|
|
14
|
+
if (mutableNode.key.name !== undefined) {
|
|
15
|
+
mutableNode.key.name = to
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (mutableNode.key.value !== undefined) {
|
|
19
|
+
mutableNode.key.value = to
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return mutableNode
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const renameObjectProperty = (from, to) => {
|
|
27
|
+
baseRenameLogic(jscodeshift.ObjectProperty, from, to)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const renameTypeScriptPropertySignature = (from, to) => {
|
|
31
|
+
baseRenameLogic(jscodeshift.TSPropertySignature, from, to)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
renameObjectProperty('cacheTime', 'gcTime')
|
|
35
|
+
renameObjectProperty('useErrorBoundary', 'throwOnError')
|
|
36
|
+
|
|
37
|
+
renameTypeScriptPropertySignature('cacheTime', 'gcTime')
|
|
38
|
+
renameTypeScriptPropertySignature('useErrorBoundary', 'throwOnError')
|
|
39
|
+
|
|
40
|
+
return root.toSource({ quote: 'single', lineTerminator: '\n' })
|
|
41
|
+
}
|
|
@@ -27,6 +27,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
mod
|
|
28
28
|
));
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/HydrationBoundary.tsx
|
|
30
32
|
var HydrationBoundary_exports = {};
|
|
31
33
|
__export(HydrationBoundary_exports, {
|
|
32
34
|
HydrationBoundary: () => HydrationBoundary
|
|
@@ -34,8 +36,8 @@ __export(HydrationBoundary_exports, {
|
|
|
34
36
|
module.exports = __toCommonJS(HydrationBoundary_exports);
|
|
35
37
|
var React = __toESM(require("react"), 1);
|
|
36
38
|
var import_query_core = require("@tanstack/query-core");
|
|
37
|
-
var import_QueryClientProvider = require("./QueryClientProvider");
|
|
38
|
-
|
|
39
|
+
var import_QueryClientProvider = require("./QueryClientProvider.cjs");
|
|
40
|
+
var HydrationBoundary = ({
|
|
39
41
|
children,
|
|
40
42
|
options = {},
|
|
41
43
|
state,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n optionsRef.current = options\n\n // Running hydrate again with the same queries is safe,\n // it wont overwrite or initialize existing queries,\n // relying on useMemo here is only a performance optimization.\n // hydrate can and should be run *during* render here for SSR to work properly\n React.useMemo(() => {\n if (state) {\n hydrate(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n optionsRef.current = options\n\n // Running hydrate again with the same queries is safe,\n // it wont overwrite or initialize existing queries,\n // relying on useMemo here is only a performance optimization.\n // hydrate can and should be run *during* render here for SSR to work properly\n React.useMemo(() => {\n if (state) {\n hydrate(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAEvB,wBAAwB;AACxB,iCAA+B;AAUxB,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,aAAS,2CAAe,WAAW;AAEzC,QAAM,aAAmB,aAAO,OAAO;AACvC,aAAW,UAAU;AAMrB,EAAM,cAAQ,MAAM;AAClB,QAAI,OAAO;AACT,qCAAQ,QAAQ,OAAO,WAAW,OAAO;AAAA,IAC3C;AAAA,EACF,GAAG,CAAC,QAAQ,KAAK,CAAC;AAElB,SAAO;AACT;","names":[]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
|
|
3
|
+
// src/HydrationBoundary.tsx
|
|
2
4
|
import * as React from "react";
|
|
3
5
|
import { hydrate } from "@tanstack/query-core";
|
|
4
|
-
import { useQueryClient } from "./QueryClientProvider";
|
|
5
|
-
|
|
6
|
+
import { useQueryClient } from "./QueryClientProvider.js";
|
|
7
|
+
var HydrationBoundary = ({
|
|
6
8
|
children,
|
|
7
9
|
options = {},
|
|
8
10
|
state,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n optionsRef.current = options\n\n // Running hydrate again with the same queries is safe,\n // it wont overwrite or initialize existing queries,\n // relying on useMemo here is only a performance optimization.\n // hydrate can and should be run *during* render here for SSR to work properly\n React.useMemo(() => {\n if (state) {\n hydrate(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/HydrationBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type { HydrateOptions, QueryClient } from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state?: unknown\n options?: HydrateOptions\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n optionsRef.current = options\n\n // Running hydrate again with the same queries is safe,\n // it wont overwrite or initialize existing queries,\n // relying on useMemo here is only a performance optimization.\n // hydrate can and should be run *during* render here for SSR to work properly\n React.useMemo(() => {\n if (state) {\n hydrate(client, state, optionsRef.current)\n }\n }, [client, state])\n\n return children as React.ReactElement\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAEvB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAUxB,IAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA,UAAU,CAAC;AAAA,EACX;AAAA,EACA;AACF,MAA8B;AAC5B,QAAM,SAAS,eAAe,WAAW;AAEzC,QAAM,aAAmB,aAAO,OAAO;AACvC,aAAW,UAAU;AAMrB,EAAM,cAAQ,MAAM;AAClB,QAAI,OAAO;AACT,cAAQ,QAAQ,OAAO,WAAW,OAAO;AAAA,IAC3C;AAAA,EACF,GAAG,CAAC,QAAQ,KAAK,CAAC;AAElB,SAAO;AACT;","names":[]}
|
|
@@ -27,6 +27,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
mod
|
|
28
28
|
));
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/QueryClientProvider.tsx
|
|
30
32
|
var QueryClientProvider_exports = {};
|
|
31
33
|
__export(QueryClientProvider_exports, {
|
|
32
34
|
QueryClientContext: () => QueryClientContext,
|
|
@@ -35,10 +37,10 @@ __export(QueryClientProvider_exports, {
|
|
|
35
37
|
});
|
|
36
38
|
module.exports = __toCommonJS(QueryClientProvider_exports);
|
|
37
39
|
var React = __toESM(require("react"), 1);
|
|
38
|
-
|
|
40
|
+
var QueryClientContext = React.createContext(
|
|
39
41
|
void 0
|
|
40
42
|
);
|
|
41
|
-
|
|
43
|
+
var useQueryClient = (queryClient) => {
|
|
42
44
|
const client = React.useContext(QueryClientContext);
|
|
43
45
|
if (queryClient) {
|
|
44
46
|
return queryClient;
|
|
@@ -48,7 +50,7 @@ const useQueryClient = (queryClient) => {
|
|
|
48
50
|
}
|
|
49
51
|
return client;
|
|
50
52
|
};
|
|
51
|
-
|
|
53
|
+
var QueryClientProvider = ({
|
|
52
54
|
client,
|
|
53
55
|
children
|
|
54
56
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n <QueryClientContext.Provider value={client}>\n {children}\n </QueryClientContext.Provider>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n <QueryClientContext.Provider value={client}>\n {children}\n </QueryClientContext.Provider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAIhB,IAAM,qBAA2B;AAAA,EACtC;AACF;AAEO,IAAM,iBAAiB,CAAC,gBAA8B;AAC3D,QAAM,SAAe,iBAAW,kBAAkB;AAElD,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,SAAO;AACT;AAOO,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAA6C;AAC3C,EAAM,gBAAU,MAAM;AACpB,WAAO,MAAM;AACb,WAAO,MAAM;AACX,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SACE,oCAAC,mBAAmB,UAAnB,EAA4B,OAAO,UACjC,QACH;AAEJ;","names":[]}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
|
|
3
|
+
// src/QueryClientProvider.tsx
|
|
2
4
|
import * as React from "react";
|
|
3
|
-
|
|
5
|
+
var QueryClientContext = React.createContext(
|
|
4
6
|
void 0
|
|
5
7
|
);
|
|
6
|
-
|
|
8
|
+
var useQueryClient = (queryClient) => {
|
|
7
9
|
const client = React.useContext(QueryClientContext);
|
|
8
10
|
if (queryClient) {
|
|
9
11
|
return queryClient;
|
|
@@ -13,7 +15,7 @@ const useQueryClient = (queryClient) => {
|
|
|
13
15
|
}
|
|
14
16
|
return client;
|
|
15
17
|
};
|
|
16
|
-
|
|
18
|
+
var QueryClientProvider = ({
|
|
17
19
|
client,
|
|
18
20
|
children
|
|
19
21
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n <QueryClientContext.Provider value={client}>\n {children}\n </QueryClientContext.Provider>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/QueryClientProvider.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext<QueryClient | undefined>(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n <QueryClientContext.Provider value={client}>\n {children}\n </QueryClientContext.Provider>\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAIhB,IAAM,qBAA2B;AAAA,EACtC;AACF;AAEO,IAAM,iBAAiB,CAAC,gBAA8B;AAC3D,QAAM,SAAe,iBAAW,kBAAkB;AAElD,MAAI,aAAa;AACf,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,SAAO;AACT;AAOO,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAA6C;AAC3C,EAAM,gBAAU,MAAM;AACpB,WAAO,MAAM;AACb,WAAO,MAAM;AACX,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AAEX,SACE,oCAAC,mBAAmB,UAAnB,EAA4B,OAAO,UACjC,QACH;AAEJ;","names":[]}
|
|
@@ -27,6 +27,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
mod
|
|
28
28
|
));
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/QueryErrorResetBoundary.tsx
|
|
30
32
|
var QueryErrorResetBoundary_exports = {};
|
|
31
33
|
__export(QueryErrorResetBoundary_exports, {
|
|
32
34
|
QueryErrorResetBoundary: () => QueryErrorResetBoundary,
|
|
@@ -48,9 +50,9 @@ function createValue() {
|
|
|
48
50
|
}
|
|
49
51
|
};
|
|
50
52
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
var QueryErrorResetBoundaryContext = React.createContext(createValue());
|
|
54
|
+
var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);
|
|
55
|
+
var QueryErrorResetBoundary = ({
|
|
54
56
|
children
|
|
55
57
|
}) => {
|
|
56
58
|
const [value] = React.useState(() => createValue());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: () => void\n isReset: () => boolean\n reset: () => void\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport interface QueryErrorResetBoundaryProps {\n children:\n | ((value: QueryErrorResetBoundaryValue) => React.ReactNode)\n | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n <QueryErrorResetBoundaryContext.Provider value={value}>\n {typeof children === 'function'\n ? (children as Function)(value)\n : children}\n </QueryErrorResetBoundaryContext.Provider>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: () => void\n isReset: () => boolean\n reset: () => void\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport interface QueryErrorResetBoundaryProps {\n children:\n | ((value: QueryErrorResetBoundaryValue) => React.ReactNode)\n | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n <QueryErrorResetBoundaryContext.Provider value={value}>\n {typeof children === 'function'\n ? (children as Function)(value)\n : children}\n </QueryErrorResetBoundaryContext.Provider>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AAUvB,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAU1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,oCAAC,+BAA+B,UAA/B,EAAwC,SACtC,OAAO,aAAa,aAChB,SAAsB,KAAK,IAC5B,QACN;AAEJ;","names":[]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
|
|
3
|
+
// src/QueryErrorResetBoundary.tsx
|
|
2
4
|
import * as React from "react";
|
|
3
5
|
function createValue() {
|
|
4
6
|
let isReset = false;
|
|
@@ -14,9 +16,9 @@ function createValue() {
|
|
|
14
16
|
}
|
|
15
17
|
};
|
|
16
18
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
var QueryErrorResetBoundaryContext = React.createContext(createValue());
|
|
20
|
+
var useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);
|
|
21
|
+
var QueryErrorResetBoundary = ({
|
|
20
22
|
children
|
|
21
23
|
}) => {
|
|
22
24
|
const [value] = React.useState(() => createValue());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: () => void\n isReset: () => boolean\n reset: () => void\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport interface QueryErrorResetBoundaryProps {\n children:\n | ((value: QueryErrorResetBoundaryValue) => React.ReactNode)\n | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n <QueryErrorResetBoundaryContext.Provider value={value}>\n {typeof children === 'function'\n ? (children as Function)(value)\n : children}\n </QueryErrorResetBoundaryContext.Provider>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/QueryErrorResetBoundary.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\n// CONTEXT\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: () => void\n isReset: () => boolean\n reset: () => void\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport interface QueryErrorResetBoundaryProps {\n children:\n | ((value: QueryErrorResetBoundaryValue) => React.ReactNode)\n | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n <QueryErrorResetBoundaryContext.Provider value={value}>\n {typeof children === 'function'\n ? (children as Function)(value)\n : children}\n </QueryErrorResetBoundaryContext.Provider>\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AAUvB,SAAS,cAA4C;AACnD,MAAI,UAAU;AACd,SAAO;AAAA,IACL,YAAY,MAAM;AAChB,gBAAU;AAAA,IACZ;AAAA,IACA,OAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,IACA,SAAS,MAAM;AACb,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEA,IAAM,iCAAuC,oBAAc,YAAY,CAAC;AAIjE,IAAM,6BAA6B,MAClC,iBAAW,8BAA8B;AAU1C,IAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,MAAoC;AAClC,QAAM,CAAC,KAAK,IAAU,eAAS,MAAM,YAAY,CAAC;AAClD,SACE,oCAAC,+BAA+B,UAA/B,EAAwC,SACtC,OAAO,aAAa,aAChB,SAAsB,KAAK,IAC5B,QACN;AAEJ;","names":[]}
|
|
@@ -27,6 +27,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
mod
|
|
28
28
|
));
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/errorBoundaryUtils.ts
|
|
30
32
|
var errorBoundaryUtils_exports = {};
|
|
31
33
|
__export(errorBoundaryUtils_exports, {
|
|
32
34
|
ensurePreventErrorBoundaryRetry: () => ensurePreventErrorBoundaryRetry,
|
|
@@ -35,20 +37,20 @@ __export(errorBoundaryUtils_exports, {
|
|
|
35
37
|
});
|
|
36
38
|
module.exports = __toCommonJS(errorBoundaryUtils_exports);
|
|
37
39
|
var React = __toESM(require("react"), 1);
|
|
38
|
-
var import_utils = require("./utils");
|
|
39
|
-
|
|
40
|
+
var import_utils = require("./utils.cjs");
|
|
41
|
+
var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {
|
|
40
42
|
if (options.suspense || options.throwOnError) {
|
|
41
43
|
if (!errorResetBoundary.isReset()) {
|
|
42
44
|
options.retryOnMount = false;
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
};
|
|
46
|
-
|
|
48
|
+
var useClearResetErrorBoundary = (errorResetBoundary) => {
|
|
47
49
|
React.useEffect(() => {
|
|
48
50
|
errorResetBoundary.clearReset();
|
|
49
51
|
}, [errorResetBoundary]);
|
|
50
52
|
};
|
|
51
|
-
|
|
53
|
+
var getHasError = ({
|
|
52
54
|
result,
|
|
53
55
|
errorResetBoundary,
|
|
54
56
|
throwOnError,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n if (options.suspense || options.throwOnError) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n shouldThrowError(throwOnError, [result.error, query])\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n if (options.suspense || options.throwOnError) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n shouldThrowError(throwOnError, [result.error, query])\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,YAAuB;AACvB,mBAAiC;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,uBACG;AACH,MAAI,QAAQ,YAAY,QAAQ,cAAc;AAE5C,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAKM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,kBACR,+BAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAExD;","names":[]}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
|
|
3
|
+
// src/errorBoundaryUtils.ts
|
|
2
4
|
import * as React from "react";
|
|
3
|
-
import { shouldThrowError } from "./utils";
|
|
4
|
-
|
|
5
|
+
import { shouldThrowError } from "./utils.js";
|
|
6
|
+
var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {
|
|
5
7
|
if (options.suspense || options.throwOnError) {
|
|
6
8
|
if (!errorResetBoundary.isReset()) {
|
|
7
9
|
options.retryOnMount = false;
|
|
8
10
|
}
|
|
9
11
|
}
|
|
10
12
|
};
|
|
11
|
-
|
|
13
|
+
var useClearResetErrorBoundary = (errorResetBoundary) => {
|
|
12
14
|
React.useEffect(() => {
|
|
13
15
|
errorResetBoundary.clearReset();
|
|
14
16
|
}, [errorResetBoundary]);
|
|
15
17
|
};
|
|
16
|
-
|
|
18
|
+
var getHasError = ({
|
|
17
19
|
result,
|
|
18
20
|
errorResetBoundary,
|
|
19
21
|
throwOnError,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n if (options.suspense || options.throwOnError) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n shouldThrowError(throwOnError, [result.error, query])\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/errorBoundaryUtils.ts"],"sourcesContent":["'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n if (options.suspense || options.throwOnError) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n}: {\n result: QueryObserverResult<TData, TError>\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError<TQueryFnData, TError, TQueryData, TQueryKey>\n query: Query<TQueryFnData, TError, TQueryData, TQueryKey>\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n shouldThrowError(throwOnError, [result.error, query])\n )\n}\n"],"mappings":";;;AACA,YAAY,WAAW;AACvB,SAAS,wBAAwB;AAU1B,IAAM,kCAAkC,CAO7C,SAOA,uBACG;AACH,MAAI,QAAQ,YAAY,QAAQ,cAAc;AAE5C,QAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAQ,eAAe;AAAA,IACzB;AAAA,EACF;AACF;AAEO,IAAM,6BAA6B,CACxC,uBACG;AACH,EAAM,gBAAU,MAAM;AACpB,uBAAmB,WAAW;AAAA,EAChC,GAAG,CAAC,kBAAkB,CAAC;AACzB;AAEO,IAAM,cAAc,CAMzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAKM;AACJ,SACE,OAAO,WACP,CAAC,mBAAmB,QAAQ,KAC5B,CAAC,OAAO,cACR,iBAAiB,cAAc,CAAC,OAAO,OAAO,KAAK,CAAC;AAExD;","names":[]}
|
package/build/legacy/index.cjs
CHANGED
|
@@ -17,6 +17,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
};
|
|
18
18
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
20
22
|
var src_exports = {};
|
|
21
23
|
__export(src_exports, {
|
|
22
24
|
HydrationBoundary: () => import_HydrationBoundary.HydrationBoundary,
|
|
@@ -24,6 +26,7 @@ __export(src_exports, {
|
|
|
24
26
|
QueryClientContext: () => import_QueryClientProvider.QueryClientContext,
|
|
25
27
|
QueryClientProvider: () => import_QueryClientProvider.QueryClientProvider,
|
|
26
28
|
QueryErrorResetBoundary: () => import_QueryErrorResetBoundary.QueryErrorResetBoundary,
|
|
29
|
+
infiniteQueryOptions: () => import_infiniteQueryOptions.infiniteQueryOptions,
|
|
27
30
|
queryOptions: () => import_queryOptions.queryOptions,
|
|
28
31
|
useInfiniteQuery: () => import_useInfiniteQuery.useInfiniteQuery,
|
|
29
32
|
useIsFetching: () => import_useIsFetching.useIsFetching,
|
|
@@ -34,22 +37,27 @@ __export(src_exports, {
|
|
|
34
37
|
useQueries: () => import_useQueries.useQueries,
|
|
35
38
|
useQuery: () => import_useQuery.useQuery,
|
|
36
39
|
useQueryClient: () => import_QueryClientProvider.useQueryClient,
|
|
37
|
-
useQueryErrorResetBoundary: () => import_QueryErrorResetBoundary.useQueryErrorResetBoundary
|
|
40
|
+
useQueryErrorResetBoundary: () => import_QueryErrorResetBoundary.useQueryErrorResetBoundary,
|
|
41
|
+
useSuspenseInfiniteQuery: () => import_useSuspenseInfiniteQuery.useSuspenseInfiniteQuery,
|
|
42
|
+
useSuspenseQuery: () => import_useSuspenseQuery.useSuspenseQuery
|
|
38
43
|
});
|
|
39
44
|
module.exports = __toCommonJS(src_exports);
|
|
40
45
|
__reExport(src_exports, require("@tanstack/query-core"), module.exports);
|
|
41
|
-
__reExport(src_exports, require("./types"), module.exports);
|
|
42
|
-
var import_useQueries = require("./useQueries");
|
|
43
|
-
var import_useQuery = require("./useQuery");
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
46
|
+
__reExport(src_exports, require("./types.cjs"), module.exports);
|
|
47
|
+
var import_useQueries = require("./useQueries.cjs");
|
|
48
|
+
var import_useQuery = require("./useQuery.cjs");
|
|
49
|
+
var import_useSuspenseQuery = require("./useSuspenseQuery.cjs");
|
|
50
|
+
var import_useSuspenseInfiniteQuery = require("./useSuspenseInfiniteQuery.cjs");
|
|
51
|
+
var import_queryOptions = require("./queryOptions.cjs");
|
|
52
|
+
var import_infiniteQueryOptions = require("./infiniteQueryOptions.cjs");
|
|
53
|
+
var import_QueryClientProvider = require("./QueryClientProvider.cjs");
|
|
54
|
+
var import_HydrationBoundary = require("./HydrationBoundary.cjs");
|
|
55
|
+
var import_QueryErrorResetBoundary = require("./QueryErrorResetBoundary.cjs");
|
|
56
|
+
var import_useIsFetching = require("./useIsFetching.cjs");
|
|
57
|
+
var import_useMutationState = require("./useMutationState.cjs");
|
|
58
|
+
var import_useMutation = require("./useMutation.cjs");
|
|
59
|
+
var import_useInfiniteQuery = require("./useInfiniteQuery.cjs");
|
|
60
|
+
var import_isRestoring = require("./isRestoring.cjs");
|
|
53
61
|
// Annotate the CommonJS export names for ESM import in node:
|
|
54
62
|
0 && (module.exports = {
|
|
55
63
|
HydrationBoundary,
|
|
@@ -57,6 +65,7 @@ var import_isRestoring = require("./isRestoring");
|
|
|
57
65
|
QueryClientContext,
|
|
58
66
|
QueryClientProvider,
|
|
59
67
|
QueryErrorResetBoundary,
|
|
68
|
+
infiniteQueryOptions,
|
|
60
69
|
queryOptions,
|
|
61
70
|
useInfiniteQuery,
|
|
62
71
|
useIsFetching,
|
|
@@ -68,7 +77,9 @@ var import_isRestoring = require("./isRestoring");
|
|
|
68
77
|
useQuery,
|
|
69
78
|
useQueryClient,
|
|
70
79
|
useQueryErrorResetBoundary,
|
|
80
|
+
useSuspenseInfiniteQuery,
|
|
81
|
+
useSuspenseQuery,
|
|
71
82
|
...require("@tanstack/query-core"),
|
|
72
|
-
...require("./types")
|
|
83
|
+
...require("./types.cjs")
|
|
73
84
|
});
|
|
74
85
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { queryOptions } from './queryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './isRestoring'\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { useSuspenseQuery } from './useSuspenseQuery'\nexport { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'\nexport { queryOptions } from './queryOptions'\nexport { infiniteQueryOptions } from './infiniteQueryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './isRestoring'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAc,iCAHd;AAMA,wBAAc,wBANd;AAOA,wBAA2B;AAE3B,sBAAyB;AACzB,8BAAiC;AACjC,sCAAyC;AACzC,0BAA6B;AAC7B,kCAAqC;AACrC,iCAIO;AAGP,+BAAkC;AAElC,qCAGO;AACP,2BAA8B;AAC9B,8BAAgD;AAChD,yBAA4B;AAC5B,8BAAiC;AACjC,yBAAoD;","names":[]}
|
package/build/legacy/index.d.cts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export * from '@tanstack/query-core';
|
|
2
|
-
export {
|
|
2
|
+
export { DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.cjs';
|
|
3
3
|
export { QueriesOptions, QueriesResults, useQueries } from './useQueries.cjs';
|
|
4
4
|
export { useQuery } from './useQuery.cjs';
|
|
5
|
+
export { useSuspenseQuery } from './useSuspenseQuery.cjs';
|
|
6
|
+
export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.cjs';
|
|
5
7
|
export { queryOptions } from './queryOptions.cjs';
|
|
8
|
+
export { infiniteQueryOptions } from './infiniteQueryOptions.cjs';
|
|
6
9
|
export { QueryClientContext, QueryClientProvider, QueryClientProviderProps, useQueryClient } from './QueryClientProvider.cjs';
|
|
7
10
|
export { QueryErrorResetBoundary, QueryErrorResetBoundaryProps, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.cjs';
|
|
8
11
|
export { HydrationBoundary, HydrationBoundaryProps } from './HydrationBoundary.cjs';
|
package/build/legacy/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export * from '@tanstack/query-core';
|
|
2
|
-
export {
|
|
2
|
+
export { DefinedUseInfiniteQueryResult, DefinedUseQueryResult, UseBaseMutationResult, UseBaseQueryOptions, UseBaseQueryResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutateAsyncFunction, UseMutateFunction, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types.js';
|
|
3
3
|
export { QueriesOptions, QueriesResults, useQueries } from './useQueries.js';
|
|
4
4
|
export { useQuery } from './useQuery.js';
|
|
5
|
+
export { useSuspenseQuery } from './useSuspenseQuery.js';
|
|
6
|
+
export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery.js';
|
|
5
7
|
export { queryOptions } from './queryOptions.js';
|
|
8
|
+
export { infiniteQueryOptions } from './infiniteQueryOptions.js';
|
|
6
9
|
export { QueryClientContext, QueryClientProvider, QueryClientProviderProps, useQueryClient } from './QueryClientProvider.js';
|
|
7
10
|
export { QueryErrorResetBoundary, QueryErrorResetBoundaryProps, useQueryErrorResetBoundary } from './QueryErrorResetBoundary.js';
|
|
8
11
|
export { HydrationBoundary, HydrationBoundaryProps } from './HydrationBoundary.js';
|
package/build/legacy/index.js
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
|
+
// src/index.ts
|
|
1
2
|
export * from "@tanstack/query-core";
|
|
2
|
-
export * from "./types";
|
|
3
|
-
import { useQueries } from "./useQueries";
|
|
4
|
-
import { useQuery } from "./useQuery";
|
|
5
|
-
import {
|
|
3
|
+
export * from "./types.js";
|
|
4
|
+
import { useQueries } from "./useQueries.js";
|
|
5
|
+
import { useQuery } from "./useQuery.js";
|
|
6
|
+
import { useSuspenseQuery } from "./useSuspenseQuery.js";
|
|
7
|
+
import { useSuspenseInfiniteQuery } from "./useSuspenseInfiniteQuery.js";
|
|
8
|
+
import { queryOptions } from "./queryOptions.js";
|
|
9
|
+
import { infiniteQueryOptions } from "./infiniteQueryOptions.js";
|
|
6
10
|
import {
|
|
7
11
|
QueryClientContext,
|
|
8
12
|
QueryClientProvider,
|
|
9
13
|
useQueryClient
|
|
10
|
-
} from "./QueryClientProvider";
|
|
11
|
-
import { HydrationBoundary } from "./HydrationBoundary";
|
|
14
|
+
} from "./QueryClientProvider.js";
|
|
15
|
+
import { HydrationBoundary } from "./HydrationBoundary.js";
|
|
12
16
|
import {
|
|
13
17
|
QueryErrorResetBoundary,
|
|
14
18
|
useQueryErrorResetBoundary
|
|
15
|
-
} from "./QueryErrorResetBoundary";
|
|
16
|
-
import { useIsFetching } from "./useIsFetching";
|
|
17
|
-
import { useIsMutating, useMutationState } from "./useMutationState";
|
|
18
|
-
import { useMutation } from "./useMutation";
|
|
19
|
-
import { useInfiniteQuery } from "./useInfiniteQuery";
|
|
20
|
-
import { useIsRestoring, IsRestoringProvider } from "./isRestoring";
|
|
19
|
+
} from "./QueryErrorResetBoundary.js";
|
|
20
|
+
import { useIsFetching } from "./useIsFetching.js";
|
|
21
|
+
import { useIsMutating, useMutationState } from "./useMutationState.js";
|
|
22
|
+
import { useMutation } from "./useMutation.js";
|
|
23
|
+
import { useInfiniteQuery } from "./useInfiniteQuery.js";
|
|
24
|
+
import { useIsRestoring, IsRestoringProvider } from "./isRestoring.js";
|
|
21
25
|
export {
|
|
22
26
|
HydrationBoundary,
|
|
23
27
|
IsRestoringProvider,
|
|
24
28
|
QueryClientContext,
|
|
25
29
|
QueryClientProvider,
|
|
26
30
|
QueryErrorResetBoundary,
|
|
31
|
+
infiniteQueryOptions,
|
|
27
32
|
queryOptions,
|
|
28
33
|
useInfiniteQuery,
|
|
29
34
|
useIsFetching,
|
|
@@ -34,6 +39,8 @@ export {
|
|
|
34
39
|
useQueries,
|
|
35
40
|
useQuery,
|
|
36
41
|
useQueryClient,
|
|
37
|
-
useQueryErrorResetBoundary
|
|
42
|
+
useQueryErrorResetBoundary,
|
|
43
|
+
useSuspenseInfiniteQuery,
|
|
44
|
+
useSuspenseQuery
|
|
38
45
|
};
|
|
39
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { queryOptions } from './queryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './isRestoring'\n"],"mappings":"AAGA,cAAc;AAGd,cAAc;AACd,SAAS,kBAAkB;AAE3B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,yBAAyB;AAElC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,eAAe,wBAAwB;AAChD,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AACjC,SAAS,gBAAgB,2BAA2B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["/* istanbul ignore file */\n\n// Re-export core\nexport * from '@tanstack/query-core'\n\n// React Query\nexport * from './types'\nexport { useQueries } from './useQueries'\nexport type { QueriesResults, QueriesOptions } from './useQueries'\nexport { useQuery } from './useQuery'\nexport { useSuspenseQuery } from './useSuspenseQuery'\nexport { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'\nexport { queryOptions } from './queryOptions'\nexport { infiniteQueryOptions } from './infiniteQueryOptions'\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient,\n} from './QueryClientProvider'\nexport type { QueryClientProviderProps } from './QueryClientProvider'\nexport type { QueryErrorResetBoundaryProps } from './QueryErrorResetBoundary'\nexport { HydrationBoundary } from './HydrationBoundary'\nexport type { HydrationBoundaryProps } from './HydrationBoundary'\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary,\n} from './QueryErrorResetBoundary'\nexport { useIsFetching } from './useIsFetching'\nexport { useIsMutating, useMutationState } from './useMutationState'\nexport { useMutation } from './useMutation'\nexport { useInfiniteQuery } from './useInfiniteQuery'\nexport { useIsRestoring, IsRestoringProvider } from './isRestoring'\n"],"mappings":";AAGA,cAAc;AAGd,cAAc;AACd,SAAS,kBAAkB;AAE3B,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,yBAAyB;AAElC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAC9B,SAAS,eAAe,wBAAwB;AAChD,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AACjC,SAAS,gBAAgB,2BAA2B;","names":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/infiniteQueryOptions.ts
|
|
21
|
+
var infiniteQueryOptions_exports = {};
|
|
22
|
+
__export(infiniteQueryOptions_exports, {
|
|
23
|
+
infiniteQueryOptions: () => infiniteQueryOptions
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(infiniteQueryOptions_exports);
|
|
26
|
+
function infiniteQueryOptions(options) {
|
|
27
|
+
return options;
|
|
28
|
+
}
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
infiniteQueryOptions
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=infiniteQueryOptions.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/infiniteQueryOptions.ts"],"sourcesContent":["import type { InfiniteData } from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\nimport type { DefaultError, QueryKey } from '@tanstack/query-core'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n> & {\n initialData?: undefined\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n> & {\n initialData: InfiniteData<TQueryData> | (() => InfiniteData<TQueryData>)\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n>\n\nexport function infiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryFnData,\n TQueryKey,\n TPageParam\n>\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0FO,SAAS,qBAAqB,SAAkB;AACrD,SAAO;AACT;","names":[]}
|