@suspensive/react-query-4 3.19.5 → 4.0.0-next.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/dist/ClientOnly-BSe1ROuK.cjs +20 -0
- package/dist/ClientOnly-BSe1ROuK.cjs.map +1 -0
- package/dist/ClientOnly-D2JpP9Ba.mjs +15 -0
- package/dist/ClientOnly-D2JpP9Ba.mjs.map +1 -0
- package/dist/IsFetching-BGIRMA6C.cjs +17 -0
- package/dist/IsFetching-BGIRMA6C.cjs.map +1 -0
- package/dist/IsFetching-CJrzs0ET.d.mts +16 -0
- package/dist/IsFetching-CJrzs0ET.d.mts.map +1 -0
- package/dist/IsFetching-Di9jXfRH.mjs +12 -0
- package/dist/IsFetching-Di9jXfRH.mjs.map +1 -0
- package/dist/IsFetching-FFvHWt5I.d.cts +16 -0
- package/dist/IsFetching-FFvHWt5I.d.cts.map +1 -0
- package/dist/IsFetching.cjs +2 -18
- package/dist/IsFetching.d.cts +2 -18
- package/dist/IsFetching.d.mts +2 -18
- package/dist/IsFetching.mjs +2 -17
- package/dist/Mutation-BWER242k.cjs +19 -0
- package/dist/Mutation-BWER242k.cjs.map +1 -0
- package/dist/Mutation-SB8NYSR4.mjs +14 -0
- package/dist/Mutation-SB8NYSR4.mjs.map +1 -0
- package/dist/Mutation-rhItOp02.d.cts +14 -0
- package/dist/Mutation-rhItOp02.d.cts.map +1 -0
- package/dist/Mutation-sfj_v5Fj.d.mts +14 -0
- package/dist/Mutation-sfj_v5Fj.d.mts.map +1 -0
- package/dist/Mutation.cjs +2 -14
- package/dist/Mutation.d.cts +2 -14
- package/dist/Mutation.d.mts +2 -14
- package/dist/Mutation.mjs +2 -13
- package/dist/PrefetchInfiniteQuery-BH6xERH5.mjs +20 -0
- package/dist/PrefetchInfiniteQuery-BH6xERH5.mjs.map +1 -0
- package/dist/PrefetchInfiniteQuery-Bf5JUe7U.cjs +25 -0
- package/dist/PrefetchInfiniteQuery-Bf5JUe7U.cjs.map +1 -0
- package/dist/PrefetchInfiniteQuery-CBl7Fblo.d.cts +17 -0
- package/dist/PrefetchInfiniteQuery-CBl7Fblo.d.cts.map +1 -0
- package/dist/PrefetchInfiniteQuery-CNNJphhx.d.mts +17 -0
- package/dist/PrefetchInfiniteQuery-CNNJphhx.d.mts.map +1 -0
- package/dist/PrefetchInfiniteQuery.cjs +2 -20
- package/dist/PrefetchInfiniteQuery.d.cts +2 -16
- package/dist/PrefetchInfiniteQuery.d.mts +2 -16
- package/dist/PrefetchInfiniteQuery.mjs +2 -19
- package/dist/PrefetchQuery-BmQt_WJk.d.mts +17 -0
- package/dist/PrefetchQuery-BmQt_WJk.d.mts.map +1 -0
- package/dist/PrefetchQuery-CqWzm0Tu.d.cts +17 -0
- package/dist/PrefetchQuery-CqWzm0Tu.d.cts.map +1 -0
- package/dist/PrefetchQuery-DQFTAE7M.mjs +20 -0
- package/dist/PrefetchQuery-DQFTAE7M.mjs.map +1 -0
- package/dist/PrefetchQuery-PBReP6tu.cjs +25 -0
- package/dist/PrefetchQuery-PBReP6tu.cjs.map +1 -0
- package/dist/PrefetchQuery.cjs +2 -20
- package/dist/PrefetchQuery.d.cts +2 -16
- package/dist/PrefetchQuery.d.mts +2 -16
- package/dist/PrefetchQuery.mjs +2 -19
- package/dist/QueriesHydration-B28Xmf0f.d.cts +106 -0
- package/dist/QueriesHydration-B28Xmf0f.d.cts.map +1 -0
- package/dist/QueriesHydration-CbLB0bKz.mjs +143 -0
- package/dist/QueriesHydration-CbLB0bKz.mjs.map +1 -0
- package/dist/QueriesHydration-Cd2lBXvZ.cjs +148 -0
- package/dist/QueriesHydration-Cd2lBXvZ.cjs.map +1 -0
- package/dist/QueriesHydration-D8Kdp7yq.d.mts +106 -0
- package/dist/QueriesHydration-D8Kdp7yq.d.mts.map +1 -0
- package/dist/QueriesHydration.cjs +2 -117
- package/dist/QueriesHydration.d.cts +2 -105
- package/dist/QueriesHydration.d.mts +2 -105
- package/dist/QueriesHydration.mjs +2 -116
- package/dist/QueryClientConsumer-B5vPlxA7.mjs +14 -0
- package/dist/QueryClientConsumer-B5vPlxA7.mjs.map +1 -0
- package/dist/QueryClientConsumer-COVqqi9y.d.cts +18 -0
- package/dist/QueryClientConsumer-COVqqi9y.d.cts.map +1 -0
- package/dist/QueryClientConsumer-CsNJXJGM.cjs +19 -0
- package/dist/QueryClientConsumer-CsNJXJGM.cjs.map +1 -0
- package/dist/QueryClientConsumer-YLHVJlTq.d.mts +18 -0
- package/dist/QueryClientConsumer-YLHVJlTq.d.mts.map +1 -0
- package/dist/QueryClientConsumer.cjs +2 -14
- package/dist/QueryClientConsumer.d.cts +2 -18
- package/dist/QueryClientConsumer.d.mts +2 -18
- package/dist/QueryClientConsumer.mjs +2 -13
- package/dist/SuspenseInfiniteQuery-BZ3SvXkD.mjs +30 -0
- package/dist/SuspenseInfiniteQuery-BZ3SvXkD.mjs.map +1 -0
- package/dist/SuspenseInfiniteQuery-ByTjC7r9.d.cts +31 -0
- package/dist/SuspenseInfiniteQuery-ByTjC7r9.d.cts.map +1 -0
- package/dist/SuspenseInfiniteQuery-asj0bHeh.d.mts +31 -0
- package/dist/SuspenseInfiniteQuery-asj0bHeh.d.mts.map +1 -0
- package/dist/SuspenseInfiniteQuery-qAybH413.cjs +35 -0
- package/dist/SuspenseInfiniteQuery-qAybH413.cjs.map +1 -0
- package/dist/SuspenseInfiniteQuery.cjs +2 -30
- package/dist/SuspenseInfiniteQuery.d.cts +2 -31
- package/dist/SuspenseInfiniteQuery.d.mts +2 -31
- package/dist/SuspenseInfiniteQuery.mjs +2 -29
- package/dist/SuspenseQueries-CZJAU3Eq.d.cts +31 -0
- package/dist/SuspenseQueries-CZJAU3Eq.d.cts.map +1 -0
- package/dist/SuspenseQueries-DlBy4veI.cjs +31 -0
- package/dist/SuspenseQueries-DlBy4veI.cjs.map +1 -0
- package/dist/SuspenseQueries-Dv6SQx-C.mjs +26 -0
- package/dist/SuspenseQueries-Dv6SQx-C.mjs.map +1 -0
- package/dist/SuspenseQueries-Nv07W4mb.d.mts +31 -0
- package/dist/SuspenseQueries-Nv07W4mb.d.mts.map +1 -0
- package/dist/SuspenseQueries.cjs +2 -26
- package/dist/SuspenseQueries.d.cts +2 -30
- package/dist/SuspenseQueries.d.mts +2 -30
- package/dist/SuspenseQueries.mjs +2 -25
- package/dist/SuspenseQuery-BNAZi5mZ.d.cts +31 -0
- package/dist/SuspenseQuery-BNAZi5mZ.d.cts.map +1 -0
- package/dist/SuspenseQuery-CGEFuzI_.cjs +35 -0
- package/dist/SuspenseQuery-CGEFuzI_.cjs.map +1 -0
- package/dist/SuspenseQuery-RbgXq6PC.mjs +30 -0
- package/dist/SuspenseQuery-RbgXq6PC.mjs.map +1 -0
- package/dist/SuspenseQuery-uHIieJ1n.d.mts +31 -0
- package/dist/SuspenseQuery-uHIieJ1n.d.mts.map +1 -0
- package/dist/SuspenseQuery.cjs +2 -30
- package/dist/SuspenseQuery.d.cts +2 -30
- package/dist/SuspenseQuery.d.mts +2 -30
- package/dist/SuspenseQuery.mjs +2 -29
- package/dist/components/ClientOnly.cjs +2 -12
- package/dist/components/ClientOnly.d.cts +13 -0
- package/dist/components/ClientOnly.d.cts.map +1 -0
- package/dist/components/ClientOnly.d.mts +13 -0
- package/dist/components/ClientOnly.d.mts.map +1 -0
- package/dist/components/ClientOnly.mjs +2 -12
- package/dist/createGetQueryClient-Cg34XLqS.cjs +68 -0
- package/dist/createGetQueryClient-Cg34XLqS.cjs.map +1 -0
- package/dist/createGetQueryClient-Cjacpz3C.mjs +63 -0
- package/dist/createGetQueryClient-Cjacpz3C.mjs.map +1 -0
- package/dist/createGetQueryClient-DI5GrATJ.d.cts +54 -0
- package/dist/createGetQueryClient-DI5GrATJ.d.cts.map +1 -0
- package/dist/createGetQueryClient-UFf6keL9.d.mts +54 -0
- package/dist/createGetQueryClient-UFf6keL9.d.mts.map +1 -0
- package/dist/createGetQueryClient.cjs +2 -63
- package/dist/createGetQueryClient.d.cts +2 -53
- package/dist/createGetQueryClient.d.mts +2 -53
- package/dist/createGetQueryClient.mjs +2 -62
- package/dist/index.cjs +12 -27
- package/dist/index.d.cts +12 -19
- package/dist/index.d.mts +12 -19
- package/dist/index.mjs +12 -19
- package/dist/mutationOptions-BdXvKAld.d.mts +7 -0
- package/dist/mutationOptions-BdXvKAld.d.mts.map +1 -0
- package/dist/mutationOptions-CBUqQakM.mjs +8 -0
- package/dist/mutationOptions-CBUqQakM.mjs.map +1 -0
- package/dist/mutationOptions-CzTorL9K.d.cts +7 -0
- package/dist/mutationOptions-CzTorL9K.d.cts.map +1 -0
- package/dist/mutationOptions-DNgLRYqd.cjs +14 -0
- package/dist/mutationOptions-DNgLRYqd.cjs.map +1 -0
- package/dist/mutationOptions.cjs +2 -9
- package/dist/mutationOptions.d.cts +2 -7
- package/dist/mutationOptions.d.mts +2 -7
- package/dist/mutationOptions.mjs +2 -7
- package/dist/objectSpread2-DTjFl4q7.mjs +67 -0
- package/dist/objectSpread2-DUnXKO-7.cjs +73 -0
- package/dist/objectWithoutProperties-BqF6LYLG.cjs +31 -0
- package/dist/objectWithoutProperties-DB_n2qVi.mjs +25 -0
- package/package.json +4 -4
- package/src/IsFetching.tsx +2 -3
- package/src/Mutation.tsx +1 -0
- package/src/PrefetchInfiniteQuery.tsx +8 -3
- package/src/PrefetchQuery.tsx +3 -3
- package/src/QueryClientConsumer.tsx +1 -0
- package/src/SuspenseInfiniteQuery.tsx +23 -2
- package/src/SuspenseQueries.tsx +1 -0
- package/src/SuspenseQuery.tsx +1 -0
- package/src/components/ClientOnly.tsx +1 -0
- package/src/createGetQueryClient.spec.tsx +77 -25
- package/src/index.ts +1 -14
- package/dist/IsFetching.cjs.map +0 -1
- package/dist/IsFetching.d.cts.map +0 -1
- package/dist/IsFetching.d.mts.map +0 -1
- package/dist/IsFetching.mjs.map +0 -1
- package/dist/Mutation.cjs.map +0 -1
- package/dist/Mutation.d.cts.map +0 -1
- package/dist/Mutation.d.mts.map +0 -1
- package/dist/Mutation.mjs.map +0 -1
- package/dist/PrefetchInfiniteQuery.cjs.map +0 -1
- package/dist/PrefetchInfiniteQuery.d.cts.map +0 -1
- package/dist/PrefetchInfiniteQuery.d.mts.map +0 -1
- package/dist/PrefetchInfiniteQuery.mjs.map +0 -1
- package/dist/PrefetchQuery.cjs.map +0 -1
- package/dist/PrefetchQuery.d.cts.map +0 -1
- package/dist/PrefetchQuery.d.mts.map +0 -1
- package/dist/PrefetchQuery.mjs.map +0 -1
- package/dist/QueriesHydration.cjs.map +0 -1
- package/dist/QueriesHydration.d.cts.map +0 -1
- package/dist/QueriesHydration.d.mts.map +0 -1
- package/dist/QueriesHydration.mjs.map +0 -1
- package/dist/QueryClientConsumer.cjs.map +0 -1
- package/dist/QueryClientConsumer.d.cts.map +0 -1
- package/dist/QueryClientConsumer.d.mts.map +0 -1
- package/dist/QueryClientConsumer.mjs.map +0 -1
- package/dist/SuspenseInfiniteQuery.cjs.map +0 -1
- package/dist/SuspenseInfiniteQuery.d.cts.map +0 -1
- package/dist/SuspenseInfiniteQuery.d.mts.map +0 -1
- package/dist/SuspenseInfiniteQuery.mjs.map +0 -1
- package/dist/SuspenseQueries.cjs.map +0 -1
- package/dist/SuspenseQueries.d.cts.map +0 -1
- package/dist/SuspenseQueries.d.mts.map +0 -1
- package/dist/SuspenseQueries.mjs.map +0 -1
- package/dist/SuspenseQuery.cjs.map +0 -1
- package/dist/SuspenseQuery.d.cts.map +0 -1
- package/dist/SuspenseQuery.d.mts.map +0 -1
- package/dist/SuspenseQuery.mjs.map +0 -1
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/asyncToGenerator.cjs +0 -29
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/asyncToGenerator.mjs +0 -28
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.cjs +0 -14
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/defineProperty.mjs +0 -14
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectSpread2.cjs +0 -27
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectSpread2.mjs +0 -27
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutProperties.cjs +0 -15
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutProperties.mjs +0 -15
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutPropertiesLoose.cjs +0 -14
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/objectWithoutPropertiesLoose.mjs +0 -13
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPrimitive.cjs +0 -16
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPrimitive.mjs +0 -16
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPropertyKey.cjs +0 -11
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/toPropertyKey.mjs +0 -11
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/typeof.cjs +0 -18
- package/dist/_virtual/_@oxc-project_runtime@0.115.0/helpers/typeof.mjs +0 -12
- package/dist/components/ClientOnly.cjs.map +0 -1
- package/dist/components/ClientOnly.mjs.map +0 -1
- package/dist/createGetQueryClient.cjs.map +0 -1
- package/dist/createGetQueryClient.d.cts.map +0 -1
- package/dist/createGetQueryClient.d.mts.map +0 -1
- package/dist/createGetQueryClient.mjs.map +0 -1
- package/dist/infiniteQueryOptions.cjs +0 -18
- package/dist/infiniteQueryOptions.cjs.map +0 -1
- package/dist/infiniteQueryOptions.d.cts +0 -28
- package/dist/infiniteQueryOptions.d.cts.map +0 -1
- package/dist/infiniteQueryOptions.d.mts +0 -28
- package/dist/infiniteQueryOptions.d.mts.map +0 -1
- package/dist/infiniteQueryOptions.mjs +0 -17
- package/dist/infiniteQueryOptions.mjs.map +0 -1
- package/dist/mutationOptions.cjs.map +0 -1
- package/dist/mutationOptions.d.cts.map +0 -1
- package/dist/mutationOptions.d.mts.map +0 -1
- package/dist/mutationOptions.mjs.map +0 -1
- package/dist/queryOptions.cjs +0 -18
- package/dist/queryOptions.cjs.map +0 -1
- package/dist/queryOptions.d.cts +0 -28
- package/dist/queryOptions.d.cts.map +0 -1
- package/dist/queryOptions.d.mts +0 -28
- package/dist/queryOptions.d.mts.map +0 -1
- package/dist/queryOptions.mjs +0 -17
- package/dist/queryOptions.mjs.map +0 -1
- package/dist/usePrefetchInfiniteQuery.cjs +0 -18
- package/dist/usePrefetchInfiniteQuery.cjs.map +0 -1
- package/dist/usePrefetchInfiniteQuery.d.cts +0 -11
- package/dist/usePrefetchInfiniteQuery.d.cts.map +0 -1
- package/dist/usePrefetchInfiniteQuery.d.mts +0 -11
- package/dist/usePrefetchInfiniteQuery.d.mts.map +0 -1
- package/dist/usePrefetchInfiniteQuery.mjs +0 -17
- package/dist/usePrefetchInfiniteQuery.mjs.map +0 -1
- package/dist/usePrefetchQuery.cjs +0 -18
- package/dist/usePrefetchQuery.cjs.map +0 -1
- package/dist/usePrefetchQuery.d.cts +0 -11
- package/dist/usePrefetchQuery.d.cts.map +0 -1
- package/dist/usePrefetchQuery.d.mts +0 -11
- package/dist/usePrefetchQuery.d.mts.map +0 -1
- package/dist/usePrefetchQuery.mjs +0 -17
- package/dist/usePrefetchQuery.mjs.map +0 -1
- package/dist/useSuspenseInfiniteQuery.cjs +0 -20
- package/dist/useSuspenseInfiniteQuery.cjs.map +0 -1
- package/dist/useSuspenseInfiniteQuery.d.cts +0 -17
- package/dist/useSuspenseInfiniteQuery.d.cts.map +0 -1
- package/dist/useSuspenseInfiniteQuery.d.mts +0 -17
- package/dist/useSuspenseInfiniteQuery.d.mts.map +0 -1
- package/dist/useSuspenseInfiniteQuery.mjs +0 -19
- package/dist/useSuspenseInfiniteQuery.mjs.map +0 -1
- package/dist/useSuspenseQueries.cjs +0 -20
- package/dist/useSuspenseQueries.cjs.map +0 -1
- package/dist/useSuspenseQueries.d.cts +0 -36
- package/dist/useSuspenseQueries.d.cts.map +0 -1
- package/dist/useSuspenseQueries.d.mts +0 -36
- package/dist/useSuspenseQueries.d.mts.map +0 -1
- package/dist/useSuspenseQueries.mjs +0 -19
- package/dist/useSuspenseQueries.mjs.map +0 -1
- package/dist/useSuspenseQuery.cjs +0 -20
- package/dist/useSuspenseQuery.cjs.map +0 -1
- package/dist/useSuspenseQuery.d.cts +0 -36
- package/dist/useSuspenseQuery.d.cts.map +0 -1
- package/dist/useSuspenseQuery.d.mts +0 -36
- package/dist/useSuspenseQuery.d.mts.map +0 -1
- package/dist/useSuspenseQuery.mjs +0 -19
- package/dist/useSuspenseQuery.mjs.map +0 -1
- package/src/IsFetching.spec.tsx +0 -34
- package/src/infiniteQueryOptions.ts +0 -77
- package/src/queryOptions.ts +0 -80
- package/src/usePrefetchInfiniteQuery.test-d.tsx +0 -14
- package/src/usePrefetchInfiniteQuery.ts +0 -19
- package/src/usePrefetchQuery.test-d.tsx +0 -14
- package/src/usePrefetchQuery.ts +0 -19
- package/src/useSuspenseInfiniteQuery.ts +0 -34
- package/src/useSuspenseQueries.ts +0 -47
- package/src/useSuspenseQuery.ts +0 -39
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
|
|
2
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/typeof.js
|
|
3
|
+
function _typeof(o) {
|
|
4
|
+
"@babel/helpers - typeof";
|
|
5
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
6
|
+
return typeof o$1;
|
|
7
|
+
} : function(o$1) {
|
|
8
|
+
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
9
|
+
}, _typeof(o);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/toPrimitive.js
|
|
14
|
+
function toPrimitive(t, r) {
|
|
15
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
16
|
+
var e = t[Symbol.toPrimitive];
|
|
17
|
+
if (void 0 !== e) {
|
|
18
|
+
var i = e.call(t, r || "default");
|
|
19
|
+
if ("object" != _typeof(i)) return i;
|
|
20
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
21
|
+
}
|
|
22
|
+
return ("string" === r ? String : Number)(t);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/toPropertyKey.js
|
|
27
|
+
function toPropertyKey(t) {
|
|
28
|
+
var i = toPrimitive(t, "string");
|
|
29
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/defineProperty.js
|
|
34
|
+
function _defineProperty(e, r, t) {
|
|
35
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
36
|
+
value: t,
|
|
37
|
+
enumerable: !0,
|
|
38
|
+
configurable: !0,
|
|
39
|
+
writable: !0
|
|
40
|
+
}) : e[r] = t, e;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/objectSpread2.js
|
|
45
|
+
function ownKeys(e, r) {
|
|
46
|
+
var t = Object.keys(e);
|
|
47
|
+
if (Object.getOwnPropertySymbols) {
|
|
48
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
49
|
+
r && (o = o.filter(function(r$1) {
|
|
50
|
+
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
51
|
+
})), t.push.apply(t, o);
|
|
52
|
+
}
|
|
53
|
+
return t;
|
|
54
|
+
}
|
|
55
|
+
function _objectSpread2(e) {
|
|
56
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
57
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
58
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
|
|
59
|
+
_defineProperty(e, r$1, t[r$1]);
|
|
60
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
61
|
+
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return e;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
Object.defineProperty(exports, '_objectSpread2', {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () {
|
|
71
|
+
return _objectSpread2;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/objectWithoutPropertiesLoose.js
|
|
3
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
4
|
+
if (null == r) return {};
|
|
5
|
+
var t = {};
|
|
6
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
7
|
+
if (e.includes(n)) continue;
|
|
8
|
+
t[n] = r[n];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/objectWithoutProperties.js
|
|
15
|
+
function _objectWithoutProperties(e, t) {
|
|
16
|
+
if (null == e) return {};
|
|
17
|
+
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
18
|
+
if (Object.getOwnPropertySymbols) {
|
|
19
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
20
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
21
|
+
}
|
|
22
|
+
return i;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
Object.defineProperty(exports, '_objectWithoutProperties', {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () {
|
|
29
|
+
return _objectWithoutProperties;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/objectWithoutPropertiesLoose.js
|
|
2
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
3
|
+
if (null == r) return {};
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
6
|
+
if (e.includes(n)) continue;
|
|
7
|
+
t[n] = r[n];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region \0@oxc-project+runtime@0.101.0/helpers/objectWithoutProperties.js
|
|
14
|
+
function _objectWithoutProperties(e, t) {
|
|
15
|
+
if (null == e) return {};
|
|
16
|
+
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
17
|
+
if (Object.getOwnPropertySymbols) {
|
|
18
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
19
|
+
for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
20
|
+
}
|
|
21
|
+
return i;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { _objectWithoutProperties as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@suspensive/react-query-4",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-next.0",
|
|
4
4
|
"description": "Suspensive interfaces for @tanstack/react-query@4",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"suspensive",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
],
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@tanstack/react-query": "4.43.0",
|
|
43
|
-
"@types/react": "^19.2.
|
|
44
|
-
"react": "^19.2.
|
|
43
|
+
"@types/react": "^19.2.7",
|
|
44
|
+
"react": "^19.2.3",
|
|
45
45
|
"@suspensive/eslint-config": "0.0.1",
|
|
46
46
|
"@suspensive/tsconfig": "0.0.0-development",
|
|
47
47
|
"@suspensive/tsdown": "0.0.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@tanstack/react-query": "
|
|
50
|
+
"@tanstack/react-query": "^4",
|
|
51
51
|
"react": "^18 || ^19"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
package/src/IsFetching.tsx
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
'use client'
|
|
2
|
+
|
|
2
3
|
import { type QueryFilters, useIsFetching } from '@tanstack/react-query'
|
|
3
4
|
import type { ReactNode } from 'react'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
|
-
* Renders the current fetching count for queries that match the given filters.
|
|
7
7
|
* @experimental This is an experimental feature.
|
|
8
8
|
*/
|
|
9
9
|
export const IsFetching = ({
|
|
10
10
|
children,
|
|
11
|
-
...filter
|
|
12
11
|
}: QueryFilters & { children: (isFetching: ReturnType<typeof useIsFetching>) => ReactNode }) => (
|
|
13
|
-
<>{children(useIsFetching(
|
|
12
|
+
<>{children(useIsFetching())}</>
|
|
14
13
|
)
|
package/src/Mutation.tsx
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
|
|
3
|
-
import {
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type FetchInfiniteQueryOptions,
|
|
5
|
+
type QueryKey,
|
|
6
|
+
type WithRequired,
|
|
7
|
+
usePrefetchInfiniteQuery,
|
|
8
|
+
} from '@tanstack/react-query'
|
|
4
9
|
|
|
5
10
|
/**
|
|
6
11
|
* A component that allows you to use `usePrefetchInfiniteQuery` in JSX, avoiding the limitations of React hooks.
|
|
@@ -15,7 +20,7 @@ export function PrefetchInfiniteQuery<
|
|
|
15
20
|
TError = unknown,
|
|
16
21
|
TData = TQueryFnData,
|
|
17
22
|
TQueryKey extends QueryKey = QueryKey,
|
|
18
|
-
>(options: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>) {
|
|
23
|
+
>(options: WithRequired<FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey'>) {
|
|
19
24
|
usePrefetchInfiniteQuery(options)
|
|
20
25
|
return <></>
|
|
21
26
|
}
|
package/src/PrefetchQuery.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
|
|
3
|
-
import { usePrefetchQuery } from '
|
|
2
|
+
|
|
3
|
+
import { type FetchQueryOptions, type QueryKey, type WithRequired, usePrefetchQuery } from '@tanstack/react-query'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* A component that allows you to use usePrefetchQuery in JSX, avoiding the limitations of React hooks.
|
|
@@ -15,7 +15,7 @@ export function PrefetchQuery<
|
|
|
15
15
|
TError = unknown,
|
|
16
16
|
TData = TQueryFnData,
|
|
17
17
|
TQueryKey extends QueryKey = QueryKey,
|
|
18
|
-
>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>) {
|
|
18
|
+
>(options: WithRequired<FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey'>) {
|
|
19
19
|
usePrefetchQuery(options)
|
|
20
20
|
return <></>
|
|
21
21
|
}
|
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type OmitKeyof,
|
|
5
|
+
type QueryKey,
|
|
6
|
+
type UseInfiniteQueryOptions,
|
|
7
|
+
type UseSuspenseInfiniteQueryResult,
|
|
8
|
+
type WithRequired,
|
|
9
|
+
useSuspenseInfiniteQuery,
|
|
10
|
+
} from '@tanstack/react-query'
|
|
3
11
|
import type { ReactNode } from 'react'
|
|
4
|
-
|
|
12
|
+
|
|
13
|
+
type UseSuspenseInfiniteQueryOptions<
|
|
14
|
+
TQueryFnData = unknown,
|
|
15
|
+
TError = unknown,
|
|
16
|
+
TData = TQueryFnData,
|
|
17
|
+
TQueryKey extends QueryKey = QueryKey,
|
|
18
|
+
> = WithRequired<
|
|
19
|
+
OmitKeyof<
|
|
20
|
+
UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>,
|
|
21
|
+
'suspense' | 'useErrorBoundary' | 'enabled' | 'placeholderData' | 'networkMode' | 'initialData'
|
|
22
|
+
>,
|
|
23
|
+
'queryKey'
|
|
24
|
+
>
|
|
25
|
+
|
|
5
26
|
/**
|
|
6
27
|
* We provide these components to clearly express what causes suspense at the same depth.
|
|
7
28
|
* `<SuspenseInfiniteQuery/>` serves to make `useSuspenseInfiniteQuery` easier to use in jsx.
|
package/src/SuspenseQueries.tsx
CHANGED
package/src/SuspenseQuery.tsx
CHANGED
|
@@ -1,32 +1,45 @@
|
|
|
1
1
|
import { QueryClient } from '@tanstack/react-query'
|
|
2
2
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|
3
|
-
import { createGetQueryClient } from './createGetQueryClient'
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
vi.
|
|
8
|
-
const actual = await importOriginal()
|
|
4
|
+
// Mock isServer from @tanstack/react-query
|
|
5
|
+
vi.mock('@tanstack/react-query', async () => {
|
|
6
|
+
const actual = await vi.importActual('@tanstack/react-query')
|
|
9
7
|
return {
|
|
10
8
|
...actual,
|
|
11
|
-
|
|
12
|
-
return mock.isServer
|
|
13
|
-
},
|
|
9
|
+
isServer: false,
|
|
14
10
|
}
|
|
15
11
|
})
|
|
16
12
|
|
|
17
|
-
describe('getQueryClient
|
|
13
|
+
describe('getQueryClient', () => {
|
|
18
14
|
beforeEach(() => {
|
|
19
|
-
|
|
15
|
+
// Reset modules to clear the browserQueryClient singleton
|
|
16
|
+
vi.resetModules()
|
|
20
17
|
})
|
|
21
18
|
|
|
22
|
-
it('should return
|
|
19
|
+
it('should return a QueryClient instance', async () => {
|
|
20
|
+
const { createGetQueryClient } = await import('./createGetQueryClient')
|
|
23
21
|
const { getQueryClient } = createGetQueryClient()
|
|
24
|
-
|
|
22
|
+
const queryClient = getQueryClient()
|
|
23
|
+
expect(queryClient).toBeInstanceOf(QueryClient)
|
|
25
24
|
})
|
|
26
25
|
|
|
27
|
-
it('should
|
|
26
|
+
it('should return the same QueryClient instance on multiple calls in browser environment', async () => {
|
|
27
|
+
const { createGetQueryClient } = await import('./createGetQueryClient')
|
|
28
|
+
const { getQueryClient } = createGetQueryClient()
|
|
29
|
+
const queryClient1 = getQueryClient()
|
|
30
|
+
const queryClient2 = getQueryClient()
|
|
31
|
+
expect(queryClient1).toBe(queryClient2)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
it('should apply config when creating initial QueryClient', async () => {
|
|
35
|
+
const { createGetQueryClient } = await import('./createGetQueryClient')
|
|
28
36
|
const { getQueryClient } = createGetQueryClient({
|
|
29
|
-
defaultOptions: {
|
|
37
|
+
defaultOptions: {
|
|
38
|
+
queries: {
|
|
39
|
+
staleTime: 5000,
|
|
40
|
+
retry: 3,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
30
43
|
})
|
|
31
44
|
const queryClient = getQueryClient()
|
|
32
45
|
expect(queryClient).toBeInstanceOf(QueryClient)
|
|
@@ -34,33 +47,72 @@ describe('getQueryClient (browser environment)', () => {
|
|
|
34
47
|
expect(queryClient.getDefaultOptions().queries?.retry).toBe(3)
|
|
35
48
|
})
|
|
36
49
|
|
|
37
|
-
it('should
|
|
50
|
+
it('should use provided cacheTime value in browser environment (not Infinity)', async () => {
|
|
51
|
+
const { createGetQueryClient } = await import('./createGetQueryClient')
|
|
38
52
|
const { getQueryClient } = createGetQueryClient({
|
|
39
|
-
defaultOptions: {
|
|
53
|
+
defaultOptions: {
|
|
54
|
+
queries: {
|
|
55
|
+
cacheTime: 5000,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
40
58
|
})
|
|
41
|
-
|
|
59
|
+
const queryClient = getQueryClient()
|
|
60
|
+
// In browser, cacheTime should use the provided value, not Infinity
|
|
61
|
+
expect(queryClient.getDefaultOptions().queries?.cacheTime).toBe(5000)
|
|
62
|
+
expect(queryClient.getDefaultOptions().queries?.cacheTime).not.toBe(Infinity)
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
it('should not set cacheTime to Infinity in browser environment when no config provided', async () => {
|
|
66
|
+
const { createGetQueryClient } = await import('./createGetQueryClient')
|
|
67
|
+
const { getQueryClient } = createGetQueryClient()
|
|
68
|
+
const queryClient = getQueryClient()
|
|
69
|
+
// In browser, cacheTime should use default value (not Infinity)
|
|
70
|
+
// Default cacheTime in React Query v4 is 5 minutes (300000ms)
|
|
71
|
+
expect(queryClient.getDefaultOptions().queries?.cacheTime).not.toBe(Infinity)
|
|
42
72
|
})
|
|
43
73
|
})
|
|
44
74
|
|
|
45
75
|
describe('getQueryClient (server environment)', () => {
|
|
46
76
|
beforeEach(() => {
|
|
47
|
-
|
|
77
|
+
vi.resetModules()
|
|
78
|
+
// Mock isServer as true for server tests
|
|
79
|
+
vi.doMock('@tanstack/react-query', async () => {
|
|
80
|
+
const actual = await vi.importActual('@tanstack/react-query')
|
|
81
|
+
return {
|
|
82
|
+
...actual,
|
|
83
|
+
isServer: true,
|
|
84
|
+
}
|
|
85
|
+
})
|
|
48
86
|
})
|
|
49
87
|
|
|
50
|
-
it('should return new QueryClient instance on each call', () => {
|
|
88
|
+
it('should return new QueryClient instance on each call in server environment', async () => {
|
|
89
|
+
const { createGetQueryClient } = await import('./createGetQueryClient')
|
|
51
90
|
const { getQueryClient } = createGetQueryClient()
|
|
52
|
-
|
|
91
|
+
const queryClient1 = getQueryClient()
|
|
92
|
+
const queryClient2 = getQueryClient()
|
|
93
|
+
expect(queryClient1).toBeInstanceOf(QueryClient)
|
|
94
|
+
expect(queryClient2).toBeInstanceOf(QueryClient)
|
|
95
|
+
expect(queryClient1).not.toBe(queryClient2)
|
|
53
96
|
})
|
|
54
97
|
|
|
55
|
-
it('should set cacheTime to Infinity to prevent OOM', () => {
|
|
98
|
+
it('should set cacheTime to Infinity in server environment to prevent OOM', async () => {
|
|
99
|
+
const { createGetQueryClient } = await import('./createGetQueryClient')
|
|
56
100
|
const { getQueryClient } = createGetQueryClient()
|
|
57
|
-
|
|
101
|
+
const queryClient = getQueryClient()
|
|
102
|
+
expect(queryClient.getDefaultOptions().queries?.cacheTime).toBe(Infinity)
|
|
58
103
|
})
|
|
59
104
|
|
|
60
|
-
it('should override cacheTime to Infinity even if config provides different value', () => {
|
|
105
|
+
it('should override cacheTime to Infinity even if config provides different value in server environment', async () => {
|
|
106
|
+
const { createGetQueryClient } = await import('./createGetQueryClient')
|
|
61
107
|
const { getQueryClient } = createGetQueryClient({
|
|
62
|
-
defaultOptions: {
|
|
108
|
+
defaultOptions: {
|
|
109
|
+
queries: {
|
|
110
|
+
cacheTime: 5000,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
63
113
|
})
|
|
64
|
-
|
|
114
|
+
const queryClient = getQueryClient()
|
|
115
|
+
// cacheTime should be Infinity regardless of config to prevent OOM on server
|
|
116
|
+
expect(queryClient.getDefaultOptions().queries?.cacheTime).toBe(Infinity)
|
|
65
117
|
})
|
|
66
118
|
})
|
package/src/index.ts
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
export { createGetQueryClient } from './createGetQueryClient'
|
|
2
|
-
export { infiniteQueryOptions } from './infiniteQueryOptions'
|
|
3
|
-
export type { SelectedInfiniteOptions, UnSelectedInfiniteOptions } from './infiniteQueryOptions'
|
|
4
|
-
export { QueriesHydration } from './QueriesHydration'
|
|
5
|
-
export { queryOptions } from './queryOptions'
|
|
6
|
-
export type { SelectedQueryOptions, UnSelectedQueryOptions } from './queryOptions'
|
|
7
|
-
export { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'
|
|
8
|
-
export { usePrefetchQuery } from './usePrefetchQuery'
|
|
9
|
-
export { useSuspenseInfiniteQuery } from './useSuspenseInfiniteQuery'
|
|
10
|
-
export type { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult } from './useSuspenseInfiniteQuery'
|
|
11
|
-
export { useSuspenseQueries } from './useSuspenseQueries'
|
|
12
|
-
export type { SuspenseQueriesOptions, SuspenseQueriesResults } from './useSuspenseQueries'
|
|
13
|
-
export { useSuspenseQuery } from './useSuspenseQuery'
|
|
14
|
-
export type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './useSuspenseQuery'
|
|
15
|
-
|
|
16
2
|
export { IsFetching } from './IsFetching'
|
|
17
3
|
export { Mutation } from './Mutation'
|
|
18
4
|
export { mutationOptions } from './mutationOptions'
|
|
19
5
|
export { PrefetchInfiniteQuery } from './PrefetchInfiniteQuery'
|
|
20
6
|
export { PrefetchQuery } from './PrefetchQuery'
|
|
7
|
+
export { QueriesHydration } from './QueriesHydration'
|
|
21
8
|
export { QueryClientConsumer } from './QueryClientConsumer'
|
|
22
9
|
export { SuspenseInfiniteQuery } from './SuspenseInfiniteQuery'
|
|
23
10
|
export { SuspenseQueries } from './SuspenseQueries'
|
package/dist/IsFetching.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IsFetching.cjs","names":[],"sources":["../src/IsFetching.tsx"],"sourcesContent":["'use client'\nimport { type QueryFilters, useIsFetching } from '@tanstack/react-query'\nimport type { ReactNode } from 'react'\n\n/**\n * Renders the current fetching count for queries that match the given filters.\n * @experimental This is an experimental feature.\n */\nexport const IsFetching = ({\n children,\n ...filter\n}: QueryFilters & { children: (isFetching: ReturnType<typeof useIsFetching>) => ReactNode }) => (\n <>{children(useIsFetching(filter))}</>\n)\n"],"mappings":";;;;;;;;mBASE;;;;;AADF,MAAa,cAAc,SAGqE;KAHrE,EACzB;AAE8F,QAC9F,mFAAG,4HAA8B,CAAC,EAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IsFetching.d.cts","names":[],"sources":["../src/IsFetching.tsx"],"mappings":";;;;;;;;AAQA;cAAa,UAAA;EAAc,QAAA;EAAA,GAAA;AAAA,GAGxB,YAAA;EAAiB,QAAA,GAAW,UAAA,EAAY,UAAA,QAAkB,aAAA,MAAmB,SAAA;AAAA,MAAW,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IsFetching.d.mts","names":[],"sources":["../src/IsFetching.tsx"],"mappings":";;;;;;;;AAQA;cAAa,UAAA;EAAc,QAAA;EAAA,GAAA;AAAA,GAGxB,YAAA;EAAiB,QAAA,GAAW,UAAA,EAAY,UAAA,QAAkB,aAAA,MAAmB,SAAA;AAAA,MAAW,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
package/dist/IsFetching.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IsFetching.mjs","names":[],"sources":["../src/IsFetching.tsx"],"sourcesContent":["'use client'\nimport { type QueryFilters, useIsFetching } from '@tanstack/react-query'\nimport type { ReactNode } from 'react'\n\n/**\n * Renders the current fetching count for queries that match the given filters.\n * @experimental This is an experimental feature.\n */\nexport const IsFetching = ({\n children,\n ...filter\n}: QueryFilters & { children: (isFetching: ReturnType<typeof useIsFetching>) => ReactNode }) => (\n <>{children(useIsFetching(filter))}</>\n)\n"],"mappings":";;;;;;;mBASE;;;;;AADF,MAAa,cAAc,SAGqE;KAHrE,EACzB;AAE8F,QAC9F,0CAAG,SAAS,wDAAqB,CAAC,EAAI"}
|
package/dist/Mutation.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Mutation.cjs","names":[],"sources":["../src/Mutation.tsx"],"sourcesContent":["'use client'\nimport { type UseMutationOptions, type UseMutationResult, useMutation } from '@tanstack/react-query'\nimport type { ReactNode } from 'react'\n\nexport function Mutation<TData = unknown, TError = unknown, TVariables = void, TContext = unknown>({\n children,\n ...options\n}: UseMutationOptions<TData, TError, TVariables, TContext> & {\n children: (mutationResult: UseMutationResult<TData, TError, TVariables, TContext>) => ReactNode\n}) {\n return <>{children(useMutation(options))}</>\n}\n"],"mappings":";;;;;;;;mBAKE;AADF,SAAgB,SAAmF,MAKhG;KALgG,EACjG;AAKA,QAAO,mFAAG,0HAA6B,CAAC,EAAI"}
|
package/dist/Mutation.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Mutation.d.cts","names":[],"sources":["../src/Mutation.tsx"],"mappings":";;;;;iBAIgB,QAAA,0EAAA,CAAA;EACd,QAAA;EAAA,GACG;AAAA,GACF,kBAAA,CAAmB,KAAA,EAAO,MAAA,EAAQ,UAAA,EAAY,QAAA;EAC/C,QAAA,GAAW,cAAA,EAAgB,iBAAA,CAAkB,KAAA,EAAO,MAAA,EAAQ,UAAA,EAAY,QAAA,MAAc,SAAA;AAAA,IACvF,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
package/dist/Mutation.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Mutation.d.mts","names":[],"sources":["../src/Mutation.tsx"],"mappings":";;;;;iBAIgB,QAAA,0EAAA,CAAA;EACd,QAAA;EAAA,GACG;AAAA,GACF,kBAAA,CAAmB,KAAA,EAAO,MAAA,EAAQ,UAAA,EAAY,QAAA;EAC/C,QAAA,GAAW,cAAA,EAAgB,iBAAA,CAAkB,KAAA,EAAO,MAAA,EAAQ,UAAA,EAAY,QAAA,MAAc,SAAA;AAAA,IACvF,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
package/dist/Mutation.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Mutation.mjs","names":[],"sources":["../src/Mutation.tsx"],"sourcesContent":["'use client'\nimport { type UseMutationOptions, type UseMutationResult, useMutation } from '@tanstack/react-query'\nimport type { ReactNode } from 'react'\n\nexport function Mutation<TData = unknown, TError = unknown, TVariables = void, TContext = unknown>({\n children,\n ...options\n}: UseMutationOptions<TData, TError, TVariables, TContext> & {\n children: (mutationResult: UseMutationResult<TData, TError, TVariables, TContext>) => ReactNode\n}) {\n return <>{children(useMutation(options))}</>\n}\n"],"mappings":";;;;;;;mBAKE;AADF,SAAgB,SAAmF,MAKhG;KALgG,EACjG;AAKA,QAAO,0CAAG,SAAS,sDAAoB,CAAC,EAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrefetchInfiniteQuery.cjs","names":[],"sources":["../src/PrefetchInfiniteQuery.tsx"],"sourcesContent":["'use client'\nimport { type FetchInfiniteQueryOptions, type QueryKey } from '@tanstack/react-query'\nimport { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'\n\n/**\n * A component that allows you to use `usePrefetchInfiniteQuery` in JSX, avoiding the limitations of React hooks.\n * @see {@link https://suspensive.org/docs/react-query/PrefetchInfiniteQuery Suspensive Docs}\n * @example\n * ```tsx\n * <PrefetchInfiniteQuery queryKey={['queryKey']} queryFn={queryFn} />\n * ```\n */\nexport function PrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(options: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>) {\n usePrefetchInfiniteQuery(options)\n return <></>\n}\n"],"mappings":";;;;;;;;;;;;;;;AAYA,SAAgB,sBAKd,SAA4E;AAC5E,2DAAyB,QAAQ;AACjC,QAAO,yEAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrefetchInfiniteQuery.d.cts","names":[],"sources":["../src/PrefetchInfiniteQuery.tsx"],"mappings":";;;;;;;AAYA;;;;;iBAAgB,qBAAA,mDAGN,YAAA,oBACU,QAAA,GAAW,QAAA,CAAA,CAC7B,OAAA,EAAS,yBAAA,CAA0B,YAAA,EAAc,MAAA,EAAQ,KAAA,EAAO,SAAA,IAAU,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrefetchInfiniteQuery.d.mts","names":[],"sources":["../src/PrefetchInfiniteQuery.tsx"],"mappings":";;;;;;;AAYA;;;;;iBAAgB,qBAAA,mDAGN,YAAA,oBACU,QAAA,GAAW,QAAA,CAAA,CAC7B,OAAA,EAAS,yBAAA,CAA0B,YAAA,EAAc,MAAA,EAAQ,KAAA,EAAO,SAAA,IAAU,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrefetchInfiniteQuery.mjs","names":[],"sources":["../src/PrefetchInfiniteQuery.tsx"],"sourcesContent":["'use client'\nimport { type FetchInfiniteQueryOptions, type QueryKey } from '@tanstack/react-query'\nimport { usePrefetchInfiniteQuery } from './usePrefetchInfiniteQuery'\n\n/**\n * A component that allows you to use `usePrefetchInfiniteQuery` in JSX, avoiding the limitations of React hooks.\n * @see {@link https://suspensive.org/docs/react-query/PrefetchInfiniteQuery Suspensive Docs}\n * @example\n * ```tsx\n * <PrefetchInfiniteQuery queryKey={['queryKey']} queryFn={queryFn} />\n * ```\n */\nexport function PrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(options: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>) {\n usePrefetchInfiniteQuery(options)\n return <></>\n}\n"],"mappings":";;;;;;;;;;;;;;AAYA,SAAgB,sBAKd,SAA4E;AAC5E,0BAAyB,QAAQ;AACjC,QAAO,gCAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrefetchQuery.cjs","names":[],"sources":["../src/PrefetchQuery.tsx"],"sourcesContent":["'use client'\nimport { type FetchQueryOptions, type QueryKey } from '@tanstack/react-query'\nimport { usePrefetchQuery } from './usePrefetchQuery'\n\n/**\n * A component that allows you to use usePrefetchQuery in JSX, avoiding the limitations of React hooks.\n * @see {@link https://suspensive.org/docs/react-query/PrefetchQuery Suspensive Docs}\n * @example\n * ```tsx\n * <PrefetchQuery queryKey={['queryKey']} queryFn={queryFn} />\n * ```\n */\nexport function PrefetchQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>) {\n usePrefetchQuery(options)\n return <></>\n}\n"],"mappings":";;;;;;;;;;;;;;;AAYA,SAAgB,cAKd,SAAoE;AACpE,2CAAiB,QAAQ;AACzB,QAAO,yEAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrefetchQuery.d.cts","names":[],"sources":["../src/PrefetchQuery.tsx"],"mappings":";;;;;;;AAYA;;;;;iBAAgB,aAAA,mDAGN,YAAA,oBACU,QAAA,GAAW,QAAA,CAAA,CAC7B,OAAA,EAAS,iBAAA,CAAkB,YAAA,EAAc,MAAA,EAAQ,KAAA,EAAO,SAAA,IAAU,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrefetchQuery.d.mts","names":[],"sources":["../src/PrefetchQuery.tsx"],"mappings":";;;;;;;AAYA;;;;;iBAAgB,aAAA,mDAGN,YAAA,oBACU,QAAA,GAAW,QAAA,CAAA,CAC7B,OAAA,EAAS,iBAAA,CAAkB,YAAA,EAAc,MAAA,EAAQ,KAAA,EAAO,SAAA,IAAU,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrefetchQuery.mjs","names":[],"sources":["../src/PrefetchQuery.tsx"],"sourcesContent":["'use client'\nimport { type FetchQueryOptions, type QueryKey } from '@tanstack/react-query'\nimport { usePrefetchQuery } from './usePrefetchQuery'\n\n/**\n * A component that allows you to use usePrefetchQuery in JSX, avoiding the limitations of React hooks.\n * @see {@link https://suspensive.org/docs/react-query/PrefetchQuery Suspensive Docs}\n * @example\n * ```tsx\n * <PrefetchQuery queryKey={['queryKey']} queryFn={queryFn} />\n * ```\n */\nexport function PrefetchQuery<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>) {\n usePrefetchQuery(options)\n return <></>\n}\n"],"mappings":";;;;;;;;;;;;;;AAYA,SAAgB,cAKd,SAAoE;AACpE,kBAAiB,QAAQ;AACzB,QAAO,gCAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueriesHydration.cjs","names":["QueryClient","ClientOnly","Hydrate"],"sources":["../src/QueriesHydration.tsx"],"sourcesContent":["import {\n Hydrate,\n type HydrateProps,\n type OmitKeyof,\n QueryClient,\n type QueryOptions,\n type UseInfiniteQueryOptions,\n type WithRequired,\n dehydrate,\n} from '@tanstack/react-query'\nimport type { ReactNode } from 'react'\nimport { ClientOnly } from './components/ClientOnly'\n\n/**\n * A server component that fetches multiple queries on the server and hydrates them to the client.\n *\n * @experimental This component is experimental and may be changed or removed in the future.\n *\n * @description\n * QueriesHydration is designed for React Server Components (RSC).\n * It pre-fetches multiple queries on the server side and automatically hydrates\n * the data to the client, enabling seamless data synchronization between server and client.\n *\n * When errors occur during server-side fetching, the component gracefully falls back\n * to client-side rendering, ensuring your application remains resilient.\n *\n * @example\n * ```tsx\n * // app/page.tsx (Server Component)\n * import { Suspense } from 'react'\n * import { QueriesHydration } from '@suspensive/react-query'\n * import { queryOptions } from '@tanstack/react-query'\n *\n * const userQueryOptions = (userId: string) => queryOptions({\n * queryKey: ['user', userId],\n * queryFn: () => fetchUser(userId)\n * })\n *\n * const postsQueryOptions = () => queryOptions({\n * queryKey: ['posts'],\n * queryFn: () => fetchPosts()\n * })\n *\n * export default function Page({ userId }: { userId: string }) {\n * return (\n * <>\n * <Suspense fallback={<div>Loading user...</div>}>\n * <QueriesHydration queries={[userQueryOptions(userId)]}>\n * <UserProfile />\n * </QueriesHydration>\n * </Suspense>\n *\n * <Suspense fallback={<div>Loading posts...</div>}>\n * <QueriesHydration queries={[postsQueryOptions()]}>\n * <PostsList />\n * </QueriesHydration>\n * </Suspense>\n * </>\n * )\n * }\n * ```\n *\n * @example\n * ```tsx\n * // With custom error fallback\n * <Suspense fallback={<div>Loading user...</div>}>\n * <QueriesHydration\n * queries={[userQueryOptions(userId)]}\n * skipSsrOnError={{ fallback: <div>Fetching on client...</div> }}\n * >\n * <UserProfile />\n * </QueriesHydration>\n * </Suspense>\n * ```\n *\n * @see {@link https://suspensive.org/docs/react-query/QueriesHydration Documentation}\n */\nexport async function QueriesHydration({\n queries,\n children,\n queryClient = new QueryClient(),\n skipSsrOnError = true,\n timeout,\n ...props\n}: {\n /**\n * The QueryClient instance to use for fetching queries.\n */\n queryClient?: QueryClient\n /**\n * An array of query options or infinite query options to be fetched on the server. Each query must include a `queryKey`.\n * You can mix regular queries and infinite queries in the same array.\n */\n queries: (\n | WithRequired<QueryOptions<any, any, any, any>, 'queryKey'>\n | WithRequired<UseInfiniteQueryOptions<any, any, any, any, any>, 'queryKey'>\n )[]\n /**\n * Controls error handling behavior:\n * - `true` (default): Skips SSR and falls back to client-side rendering when server fetch fails\n * - `false`: Proceeds with SSR without hydration (retry fetching on client component server rendering)\n * - `{ fallback: ReactNode }`: Skips SSR with custom fallback UI during client-side rendering\n */\n skipSsrOnError?:\n | boolean\n | {\n fallback: ReactNode\n }\n /**\n * The timeout in milliseconds for the query.\n * If the query takes longer than the timeout, it will be considered as an error.\n * When not set, no timeout is applied.\n */\n timeout?: number\n} & OmitKeyof<HydrateProps, 'state'>) {\n const timeoutController =\n timeout != null && timeout >= 0\n ? createTimeoutController(timeout, `QueriesHydration: timeout after ${timeout} ms)`)\n : undefined\n try {\n const queriesPromise = Promise.all(\n queries.map((query) =>\n 'getNextPageParam' in query ? queryClient.fetchInfiniteQuery(query) : queryClient.fetchQuery(query)\n )\n )\n await (timeoutController != null ? Promise.race([queriesPromise, timeoutController.promise]) : queriesPromise)\n timeoutController?.clear()\n } catch {\n timeoutController?.clear()\n if (skipSsrOnError) {\n return (\n <ClientOnly fallback={skipSsrOnError === true ? undefined : skipSsrOnError.fallback}>{children}</ClientOnly>\n )\n }\n }\n return (\n <Hydrate {...props} state={dehydrate(queryClient)}>\n {children}\n </Hydrate>\n )\n}\n\nconst createTimeoutController = (ms: number, errorMessage: string) => {\n let timerId: ReturnType<typeof setTimeout> | undefined\n return {\n promise: new Promise<never>((_, reject) => {\n timerId = setTimeout(() => reject(new Error(errorMessage)), ms)\n }),\n clear: () => timerId != null && clearTimeout(timerId),\n }\n}\n"],"mappings":";;;;;;;;;;CA8EE;CACA;CACA;CACA;CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AALF,SAAsB,iBAAiB;;;;iFAqCD;MArCC,EACrC,SACA,UACA,cAAc,IAAIA,mCAAa,EAC/B,iBAAiB,MACjB,kBACG;EAgCH,MAAM,oBACJ,WAAW,QAAQ,WAAW,IAC1B,wBAAwB,SAAS,mCAAmC,QAAQ,MAAM,GAClF;AACN,MAAI;GACF,MAAM,iBAAiB,QAAQ,IAC7B,QAAQ,KAAK,UACX,sBAAsB,QAAQ,YAAY,mBAAmB,MAAM,GAAG,YAAY,WAAW,MAAM,CACpG,CACF;AACD,SAAO,qBAAqB,OAAO,QAAQ,KAAK,CAAC,gBAAgB,kBAAkB,QAAQ,CAAC,GAAG;AAC/F,mFAAmB,OAAO;oBACpB;AACN,mFAAmB,OAAO;AAC1B,OAAI,eACF,QACE,2CAACC,+BAAD;IAAY,UAAU,mBAAmB,OAAO,SAAY,eAAe;IAAW;IAAsB;;AAIlH,SACE,2CAACC,6GAAY;GAAO,4CAAiB,YAAY;GAC9C;IACO;;;;AAId,MAAM,2BAA2B,IAAY,iBAAyB;CACpE,IAAI;AACJ,QAAO;EACL,SAAS,IAAI,SAAgB,GAAG,WAAW;AACzC,aAAU,iBAAiB,OAAO,IAAI,MAAM,aAAa,CAAC,EAAE,GAAG;IAC/D;EACF,aAAa,WAAW,QAAQ,aAAa,QAAQ;EACtD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueriesHydration.d.cts","names":[],"sources":["../src/QueriesHydration.tsx"],"mappings":";;;;;;;;AA6EA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAsB,gBAAA,CAAA;EACpB,OAAA;EACA,QAAA;EACA,WAAA;EACA,cAAA;EACA,OAAA;EAAA,GACG;AAAA;;;;EAKH,WAAA,GAAc,WAAA;;;;;EAKd,OAAA,GACI,YAAA,CAAa,YAAA,oCACb,YAAA,CAAa,uBAAA;;;;;;;EAQjB,cAAA;IAGM,QAAA,EAAU,SAAA;EAAA;;;;;;EAOhB,OAAA;AAAA,IACE,SAAA,CAAU,YAAA,aAAsB,OAAA,CAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueriesHydration.d.mts","names":[],"sources":["../src/QueriesHydration.tsx"],"mappings":";;;;;;;;AA6EA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAsB,gBAAA,CAAA;EACpB,OAAA;EACA,QAAA;EACA,WAAA;EACA,cAAA;EACA,OAAA;EAAA,GACG;AAAA;;;;EAKH,WAAA,GAAc,WAAA;;;;;EAKd,OAAA,GACI,YAAA,CAAa,YAAA,oCACb,YAAA,CAAa,uBAAA;;;;;;;EAQjB,cAAA;IAGM,QAAA,EAAU,SAAA;EAAA;;;;;;EAOhB,OAAA;AAAA,IACE,SAAA,CAAU,YAAA,aAAsB,OAAA,CAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueriesHydration.mjs","names":[],"sources":["../src/QueriesHydration.tsx"],"sourcesContent":["import {\n Hydrate,\n type HydrateProps,\n type OmitKeyof,\n QueryClient,\n type QueryOptions,\n type UseInfiniteQueryOptions,\n type WithRequired,\n dehydrate,\n} from '@tanstack/react-query'\nimport type { ReactNode } from 'react'\nimport { ClientOnly } from './components/ClientOnly'\n\n/**\n * A server component that fetches multiple queries on the server and hydrates them to the client.\n *\n * @experimental This component is experimental and may be changed or removed in the future.\n *\n * @description\n * QueriesHydration is designed for React Server Components (RSC).\n * It pre-fetches multiple queries on the server side and automatically hydrates\n * the data to the client, enabling seamless data synchronization between server and client.\n *\n * When errors occur during server-side fetching, the component gracefully falls back\n * to client-side rendering, ensuring your application remains resilient.\n *\n * @example\n * ```tsx\n * // app/page.tsx (Server Component)\n * import { Suspense } from 'react'\n * import { QueriesHydration } from '@suspensive/react-query'\n * import { queryOptions } from '@tanstack/react-query'\n *\n * const userQueryOptions = (userId: string) => queryOptions({\n * queryKey: ['user', userId],\n * queryFn: () => fetchUser(userId)\n * })\n *\n * const postsQueryOptions = () => queryOptions({\n * queryKey: ['posts'],\n * queryFn: () => fetchPosts()\n * })\n *\n * export default function Page({ userId }: { userId: string }) {\n * return (\n * <>\n * <Suspense fallback={<div>Loading user...</div>}>\n * <QueriesHydration queries={[userQueryOptions(userId)]}>\n * <UserProfile />\n * </QueriesHydration>\n * </Suspense>\n *\n * <Suspense fallback={<div>Loading posts...</div>}>\n * <QueriesHydration queries={[postsQueryOptions()]}>\n * <PostsList />\n * </QueriesHydration>\n * </Suspense>\n * </>\n * )\n * }\n * ```\n *\n * @example\n * ```tsx\n * // With custom error fallback\n * <Suspense fallback={<div>Loading user...</div>}>\n * <QueriesHydration\n * queries={[userQueryOptions(userId)]}\n * skipSsrOnError={{ fallback: <div>Fetching on client...</div> }}\n * >\n * <UserProfile />\n * </QueriesHydration>\n * </Suspense>\n * ```\n *\n * @see {@link https://suspensive.org/docs/react-query/QueriesHydration Documentation}\n */\nexport async function QueriesHydration({\n queries,\n children,\n queryClient = new QueryClient(),\n skipSsrOnError = true,\n timeout,\n ...props\n}: {\n /**\n * The QueryClient instance to use for fetching queries.\n */\n queryClient?: QueryClient\n /**\n * An array of query options or infinite query options to be fetched on the server. Each query must include a `queryKey`.\n * You can mix regular queries and infinite queries in the same array.\n */\n queries: (\n | WithRequired<QueryOptions<any, any, any, any>, 'queryKey'>\n | WithRequired<UseInfiniteQueryOptions<any, any, any, any, any>, 'queryKey'>\n )[]\n /**\n * Controls error handling behavior:\n * - `true` (default): Skips SSR and falls back to client-side rendering when server fetch fails\n * - `false`: Proceeds with SSR without hydration (retry fetching on client component server rendering)\n * - `{ fallback: ReactNode }`: Skips SSR with custom fallback UI during client-side rendering\n */\n skipSsrOnError?:\n | boolean\n | {\n fallback: ReactNode\n }\n /**\n * The timeout in milliseconds for the query.\n * If the query takes longer than the timeout, it will be considered as an error.\n * When not set, no timeout is applied.\n */\n timeout?: number\n} & OmitKeyof<HydrateProps, 'state'>) {\n const timeoutController =\n timeout != null && timeout >= 0\n ? createTimeoutController(timeout, `QueriesHydration: timeout after ${timeout} ms)`)\n : undefined\n try {\n const queriesPromise = Promise.all(\n queries.map((query) =>\n 'getNextPageParam' in query ? queryClient.fetchInfiniteQuery(query) : queryClient.fetchQuery(query)\n )\n )\n await (timeoutController != null ? Promise.race([queriesPromise, timeoutController.promise]) : queriesPromise)\n timeoutController?.clear()\n } catch {\n timeoutController?.clear()\n if (skipSsrOnError) {\n return (\n <ClientOnly fallback={skipSsrOnError === true ? undefined : skipSsrOnError.fallback}>{children}</ClientOnly>\n )\n }\n }\n return (\n <Hydrate {...props} state={dehydrate(queryClient)}>\n {children}\n </Hydrate>\n )\n}\n\nconst createTimeoutController = (ms: number, errorMessage: string) => {\n let timerId: ReturnType<typeof setTimeout> | undefined\n return {\n promise: new Promise<never>((_, reject) => {\n timerId = setTimeout(() => reject(new Error(errorMessage)), ms)\n }),\n clear: () => timerId != null && clearTimeout(timerId),\n }\n}\n"],"mappings":";;;;;;;;;CA8EE;CACA;CACA;CACA;CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AALF,SAAsB,iBAAiB;;;;wDAqCD;MArCC,EACrC,SACA,UACA,cAAc,IAAI,aAAa,EAC/B,iBAAiB,MACjB,kBACG;EAgCH,MAAM,oBACJ,WAAW,QAAQ,WAAW,IAC1B,wBAAwB,SAAS,mCAAmC,QAAQ,MAAM,GAClF;AACN,MAAI;GACF,MAAM,iBAAiB,QAAQ,IAC7B,QAAQ,KAAK,UACX,sBAAsB,QAAQ,YAAY,mBAAmB,MAAM,GAAG,YAAY,WAAW,MAAM,CACpG,CACF;AACD,SAAO,qBAAqB,OAAO,QAAQ,KAAK,CAAC,gBAAgB,kBAAkB,QAAQ,CAAC,GAAG;AAC/F,mFAAmB,OAAO;oBACpB;AACN,mFAAmB,OAAO;AAC1B,OAAI,eACF,QACE,oBAAC,YAAD;IAAY,UAAU,mBAAmB,OAAO,SAAY,eAAe;IAAW;IAAsB;;AAIlH,SACE,oBAAC,2CAAY;GAAO,OAAO,UAAU,YAAY;GAC9C;IACO;;;;AAId,MAAM,2BAA2B,IAAY,iBAAyB;CACpE,IAAI;AACJ,QAAO;EACL,SAAS,IAAI,SAAgB,GAAG,WAAW;AACzC,aAAU,iBAAiB,OAAO,IAAI,MAAM,aAAa,CAAC,EAAE,GAAG;IAC/D;EACF,aAAa,WAAW,QAAQ,aAAa,QAAQ;EACtD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueryClientConsumer.cjs","names":[],"sources":["../src/QueryClientConsumer.tsx"],"sourcesContent":["'use client'\nimport { type QueryClient, useQueryClient } from '@tanstack/react-query'\nimport type { Context, ReactNode } from 'react'\n\n/**\n * @experimental This is experimental feature.\n */\nexport function QueryClientConsumer({\n children,\n context,\n}: {\n children: (queryClient: QueryClient) => ReactNode\n context?: Context<QueryClient | undefined>\n}) {\n return <>{children(useQueryClient({ context: context as any }))}</>\n}\n"],"mappings":";;;;;;;;;;AAOA,SAAgB,oBAAoB,EAClC,UACA,WAIC;AACD,QAAO,mFAAG,mDAAwB,EAAW,SAAgB,CAAC,CAAC,EAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueryClientConsumer.d.cts","names":[],"sources":["../src/QueryClientConsumer.tsx"],"mappings":";;;;;;;;iBAOgB,mBAAA,CAAA;EACd,QAAA;EACA;AAAA;EAEA,QAAA,GAAW,WAAA,EAAa,WAAA,KAAgB,SAAA;EACxC,OAAA,GAAU,OAAA,CAAQ,WAAA;AAAA,IACnB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueryClientConsumer.d.mts","names":[],"sources":["../src/QueryClientConsumer.tsx"],"mappings":";;;;;;;;iBAOgB,mBAAA,CAAA;EACd,QAAA;EACA;AAAA;EAEA,QAAA,GAAW,WAAA,EAAa,WAAA,KAAgB,SAAA;EACxC,OAAA,GAAU,OAAA,CAAQ,WAAA;AAAA,IACnB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueryClientConsumer.mjs","names":[],"sources":["../src/QueryClientConsumer.tsx"],"sourcesContent":["'use client'\nimport { type QueryClient, useQueryClient } from '@tanstack/react-query'\nimport type { Context, ReactNode } from 'react'\n\n/**\n * @experimental This is experimental feature.\n */\nexport function QueryClientConsumer({\n children,\n context,\n}: {\n children: (queryClient: QueryClient) => ReactNode\n context?: Context<QueryClient | undefined>\n}) {\n return <>{children(useQueryClient({ context: context as any }))}</>\n}\n"],"mappings":";;;;;;;;;AAOA,SAAgB,oBAAoB,EAClC,UACA,WAIC;AACD,QAAO,0CAAG,SAAS,eAAe,EAAW,SAAgB,CAAC,CAAC,EAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SuspenseInfiniteQuery.cjs","names":[],"sources":["../src/SuspenseInfiniteQuery.tsx"],"sourcesContent":["'use client'\nimport { type QueryKey, type UseSuspenseInfiniteQueryResult, useSuspenseInfiniteQuery } from '@tanstack/react-query'\nimport type { ReactNode } from 'react'\nimport { type UseSuspenseInfiniteQueryOptions } from './useSuspenseInfiniteQuery'\n/**\n * We provide these components to clearly express what causes suspense at the same depth.\n * `<SuspenseInfiniteQuery/>` serves to make `useSuspenseInfiniteQuery` easier to use in jsx.\n * @see {@link https://suspensive.org/docs/react-query/SuspenseInfiniteQuery Suspensive Docs}\n * @example\n * ```tsx\n * import { SuspenseInfiniteQuery } from '@suspensive/react-query'\n *\n * // You can use infiniteQueryOptions as props.\n * <SuspenseInfiniteQuery {...infiniteQueryOptions()}>\n * {({ data, fetchNextPage }) => {\n * return <></>\n * }}\n * </SuspenseInfiniteQuery>\n * ```\n */\nexport const SuspenseInfiniteQuery = <\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>({\n children,\n ...options\n}: UseSuspenseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {\n children: (query: UseSuspenseInfiniteQueryResult<TData, TError>) => ReactNode\n}) => <>{children(useSuspenseInfiniteQuery(options))}</>\n"],"mappings":";;;;;;;;mBA0BE;;;;;;;;;;;;;;;;;AANF,MAAa,yBAKX,SAKI;KALJ,EACA;AAII,2FAAG,uIAA0C,CAAC,EAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SuspenseInfiniteQuery.d.cts","names":[],"sources":["../src/SuspenseInfiniteQuery.tsx"],"mappings":";;;;;;;;;AAoBA;;;;;;;;;;;;;cAAa,qBAAA,qDAGH,YAAA,oBACU,QAAA,GAAW,QAAA;EAC7B,QAAA;EAAA,GAAA;AAAA,GAGC,+BAAA,CAAgC,YAAA,EAAc,MAAA,EAAQ,KAAA,EAAO,SAAA;EAC9D,QAAA,GAAW,KAAA,EAAO,8BAAA,CAA+B,KAAA,EAAO,MAAA,MAAY,SAAA;AAAA,MACrE,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SuspenseInfiniteQuery.d.mts","names":[],"sources":["../src/SuspenseInfiniteQuery.tsx"],"mappings":";;;;;;;;;AAoBA;;;;;;;;;;;;;cAAa,qBAAA,qDAGH,YAAA,oBACU,QAAA,GAAW,QAAA;EAC7B,QAAA;EAAA,GAAA;AAAA,GAGC,+BAAA,CAAgC,YAAA,EAAc,MAAA,EAAQ,KAAA,EAAO,SAAA;EAC9D,QAAA,GAAW,KAAA,EAAO,8BAAA,CAA+B,KAAA,EAAO,MAAA,MAAY,SAAA;AAAA,MACrE,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SuspenseInfiniteQuery.mjs","names":[],"sources":["../src/SuspenseInfiniteQuery.tsx"],"sourcesContent":["'use client'\nimport { type QueryKey, type UseSuspenseInfiniteQueryResult, useSuspenseInfiniteQuery } from '@tanstack/react-query'\nimport type { ReactNode } from 'react'\nimport { type UseSuspenseInfiniteQueryOptions } from './useSuspenseInfiniteQuery'\n/**\n * We provide these components to clearly express what causes suspense at the same depth.\n * `<SuspenseInfiniteQuery/>` serves to make `useSuspenseInfiniteQuery` easier to use in jsx.\n * @see {@link https://suspensive.org/docs/react-query/SuspenseInfiniteQuery Suspensive Docs}\n * @example\n * ```tsx\n * import { SuspenseInfiniteQuery } from '@suspensive/react-query'\n *\n * // You can use infiniteQueryOptions as props.\n * <SuspenseInfiniteQuery {...infiniteQueryOptions()}>\n * {({ data, fetchNextPage }) => {\n * return <></>\n * }}\n * </SuspenseInfiniteQuery>\n * ```\n */\nexport const SuspenseInfiniteQuery = <\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>({\n children,\n ...options\n}: UseSuspenseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {\n children: (query: UseSuspenseInfiniteQueryResult<TData, TError>) => ReactNode\n}) => <>{children(useSuspenseInfiniteQuery(options))}</>\n"],"mappings":";;;;;;;mBA0BE;;;;;;;;;;;;;;;;;AANF,MAAa,yBAKX,SAKI;KALJ,EACA;AAII,kDAAG,SAAS,mEAAiC,CAAC,EAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SuspenseQueries.cjs","names":[],"sources":["../src/SuspenseQueries.tsx"],"sourcesContent":["'use client'\nimport { type SuspenseQueriesOptions, type SuspenseQueriesResults, useSuspenseQueries } from '@tanstack/react-query'\nimport type { ReactNode } from 'react'\n\n/**\n * We provide these components to clearly express what causes suspense at the same depth.\n * `<SuspenseQueries/>` serves to make `useSuspenseQueries` easier to use in jsx.\n * @see {@link https://suspensive.org/docs/react-query/SuspenseQueries Suspensive Docs}\n * @example\n * ```tsx\n * import { SuspenseQueries } from '@suspensive/react-query'\n *\n * <SuspenseQueries queries={[firstQueryOptions(), secondQueryOptions()]}>\n * {([{ data: firstQueryData }, { data: secondQueryData }]) => {\n * return <></>\n * }}\n * </SuspenseQueries>\n * ```\n */\nexport function SuspenseQueries<T extends any[]>({\n children,\n queries,\n}: {\n queries: readonly [...SuspenseQueriesOptions<T>]\n children: (queries: SuspenseQueriesResults<T>) => ReactNode\n}) {\n return <>{children(useSuspenseQueries({ queries }))}</>\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,gBAAiC,EAC/C,UACA,WAIC;AACD,QAAO,mFAAG,uDAA4B,EAAE,SAAS,CAAC,CAAC,EAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SuspenseQueries.d.cts","names":[],"sources":["../src/SuspenseQueries.tsx"],"mappings":";;;;;;;;AAmBA;;;;;;;;;;;;iBAAgB,eAAA,iBAAA,CAAA;EACd,QAAA;EACA;AAAA;EAEA,OAAA,eAAsB,sBAAA,CAAuB,CAAA;EAC7C,QAAA,GAAW,OAAA,EAAS,sBAAA,CAAuB,CAAA,MAAO,SAAA;AAAA,IACnD,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SuspenseQueries.d.mts","names":[],"sources":["../src/SuspenseQueries.tsx"],"mappings":";;;;;;;;AAmBA;;;;;;;;;;;;iBAAgB,eAAA,iBAAA,CAAA;EACd,QAAA;EACA;AAAA;EAEA,OAAA,eAAsB,sBAAA,CAAuB,CAAA;EAC7C,QAAA,GAAW,OAAA,EAAS,sBAAA,CAAuB,CAAA,MAAO,SAAA;AAAA,IACnD,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|