@suspensive/react-query-4 3.19.1 → 3.19.2
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/IsFetching-BYkNw1cs.mjs +18 -0
- package/dist/IsFetching-BYkNw1cs.mjs.map +1 -0
- package/dist/{IsFetching-D3xmE2Kn.d.mts → IsFetching-BfIQ3Qek.d.mts} +5 -2
- package/dist/IsFetching-BfIQ3Qek.d.mts.map +1 -0
- package/dist/IsFetching-BhOgGqrs.cjs +23 -0
- package/dist/IsFetching-BhOgGqrs.cjs.map +1 -0
- package/dist/{IsFetching-CThOxeZB.d.cts → IsFetching-CuftXnaJ.d.cts} +7 -4
- package/dist/IsFetching-CuftXnaJ.d.cts.map +1 -0
- package/dist/IsFetching.cjs +1 -1
- package/dist/IsFetching.d.cts +1 -1
- package/dist/IsFetching.d.mts +1 -1
- package/dist/IsFetching.mjs +1 -1
- package/dist/{Mutation-BWER242k.cjs → Mutation-CGUYEkKX.cjs} +2 -2
- package/dist/{Mutation-BWER242k.cjs.map → Mutation-CGUYEkKX.cjs.map} +1 -1
- package/dist/{Mutation-Dt5kUsd8.d.cts → Mutation-DGmP7HQI.d.cts} +3 -3
- package/dist/{Mutation-Dt5kUsd8.d.cts.map → Mutation-DGmP7HQI.d.cts.map} +1 -1
- package/dist/{Mutation-BJunfaUO.mjs → Mutation-DUJhz3rT.mjs} +2 -2
- package/dist/{Mutation-BJunfaUO.mjs.map → Mutation-DUJhz3rT.mjs.map} +1 -1
- package/dist/Mutation.cjs +1 -1
- package/dist/Mutation.d.cts +1 -1
- package/dist/Mutation.mjs +1 -1
- package/dist/{PrefetchInfiniteQuery-Dzjm5lf8.d.mts → PrefetchInfiniteQuery-BewcG5rR.d.cts} +3 -3
- package/dist/{PrefetchInfiniteQuery-DgZfL2Sb.d.cts.map → PrefetchInfiniteQuery-BewcG5rR.d.cts.map} +1 -1
- package/dist/{PrefetchInfiniteQuery-DgZfL2Sb.d.cts → PrefetchInfiniteQuery-D-3dZMEz.d.mts} +3 -3
- package/dist/{PrefetchInfiniteQuery-Dzjm5lf8.d.mts.map → PrefetchInfiniteQuery-D-3dZMEz.d.mts.map} +1 -1
- package/dist/PrefetchInfiniteQuery.d.cts +1 -1
- package/dist/PrefetchInfiniteQuery.d.mts +1 -1
- package/dist/{PrefetchQuery-CeQ0yxDL.d.cts → PrefetchQuery-Ddbt43Fk.d.cts} +3 -3
- package/dist/{PrefetchQuery-CeQ0yxDL.d.cts.map → PrefetchQuery-Ddbt43Fk.d.cts.map} +1 -1
- package/dist/{PrefetchQuery-DAqAWOeP.d.mts → PrefetchQuery-DqgbVdjY.d.mts} +3 -3
- package/dist/{PrefetchQuery-DAqAWOeP.d.mts.map → PrefetchQuery-DqgbVdjY.d.mts.map} +1 -1
- package/dist/PrefetchQuery.d.cts +1 -1
- package/dist/PrefetchQuery.d.mts +1 -1
- package/dist/{QueriesHydration-B89HKn9y.d.cts → QueriesHydration-DPogKsc4.d.mts} +3 -3
- package/dist/{QueriesHydration-B89HKn9y.d.cts.map → QueriesHydration-DPogKsc4.d.mts.map} +1 -1
- package/dist/{QueriesHydration-BeMkJU3l.d.mts → QueriesHydration-DnlRrHJ3.d.cts} +3 -3
- package/dist/{QueriesHydration-BeMkJU3l.d.mts.map → QueriesHydration-DnlRrHJ3.d.cts.map} +1 -1
- package/dist/{QueriesHydration-27lFZeB8.mjs → QueriesHydration-GQxJe_Vu.mjs} +2 -2
- package/dist/{QueriesHydration-27lFZeB8.mjs.map → QueriesHydration-GQxJe_Vu.mjs.map} +1 -1
- package/dist/{QueriesHydration-BYKU-Mte.cjs → QueriesHydration-dcSAzQNT.cjs} +2 -2
- package/dist/{QueriesHydration-BYKU-Mte.cjs.map → QueriesHydration-dcSAzQNT.cjs.map} +1 -1
- package/dist/QueriesHydration.cjs +1 -1
- package/dist/QueriesHydration.d.cts +1 -1
- package/dist/QueriesHydration.d.mts +1 -1
- package/dist/QueriesHydration.mjs +1 -1
- package/dist/{QueryClientConsumer-D3h25GmM.d.cts → QueryClientConsumer-5PZLv_8g.d.mts} +2 -2
- package/dist/{QueryClientConsumer-D3h25GmM.d.cts.map → QueryClientConsumer-5PZLv_8g.d.mts.map} +1 -1
- package/dist/{QueryClientConsumer-DNkucS1e.d.mts → QueryClientConsumer-pihgMOoA.d.cts} +3 -3
- package/dist/{QueryClientConsumer-DNkucS1e.d.mts.map → QueryClientConsumer-pihgMOoA.d.cts.map} +1 -1
- package/dist/QueryClientConsumer.d.cts +1 -1
- package/dist/QueryClientConsumer.d.mts +1 -1
- package/dist/{SuspenseInfiniteQuery-DwW5I_M2.mjs → SuspenseInfiniteQuery-BimBkaCe.mjs} +2 -2
- package/dist/{SuspenseInfiniteQuery-DwW5I_M2.mjs.map → SuspenseInfiniteQuery-BimBkaCe.mjs.map} +1 -1
- package/dist/{SuspenseInfiniteQuery-CSd2Hyym.d.mts → SuspenseInfiniteQuery-BtRviR-Z.d.mts} +3 -3
- package/dist/{SuspenseInfiniteQuery-Bt7GeiHi.d.cts.map → SuspenseInfiniteQuery-BtRviR-Z.d.mts.map} +1 -1
- package/dist/{SuspenseInfiniteQuery-Bt7GeiHi.d.cts → SuspenseInfiniteQuery-DSYC5XON.d.cts} +3 -3
- package/dist/{SuspenseInfiniteQuery-CSd2Hyym.d.mts.map → SuspenseInfiniteQuery-DSYC5XON.d.cts.map} +1 -1
- package/dist/{SuspenseInfiniteQuery-Dq97Dear.cjs → SuspenseInfiniteQuery-oVQE2P2T.cjs} +2 -2
- package/dist/{SuspenseInfiniteQuery-Dq97Dear.cjs.map → SuspenseInfiniteQuery-oVQE2P2T.cjs.map} +1 -1
- package/dist/SuspenseInfiniteQuery.cjs +1 -1
- package/dist/SuspenseInfiniteQuery.d.cts +1 -1
- package/dist/SuspenseInfiniteQuery.d.mts +1 -1
- package/dist/SuspenseInfiniteQuery.mjs +1 -1
- package/dist/{SuspenseQueries-CF_WoDIW.d.mts → SuspenseQueries-BPvriygJ.d.cts} +3 -3
- package/dist/{SuspenseQueries-B-UR1dnn.d.cts.map → SuspenseQueries-BPvriygJ.d.cts.map} +1 -1
- package/dist/{SuspenseQueries-B-UR1dnn.d.cts → SuspenseQueries-CHFS9e4y.d.mts} +3 -3
- package/dist/{SuspenseQueries-CF_WoDIW.d.mts.map → SuspenseQueries-CHFS9e4y.d.mts.map} +1 -1
- package/dist/SuspenseQueries.d.cts +1 -1
- package/dist/SuspenseQueries.d.mts +1 -1
- package/dist/{SuspenseQuery-CgN3lrzL.mjs → SuspenseQuery-BWI24top.mjs} +2 -2
- package/dist/{SuspenseQuery-CgN3lrzL.mjs.map → SuspenseQuery-BWI24top.mjs.map} +1 -1
- package/dist/{SuspenseQuery-BZ20Rsoo.d.mts → SuspenseQuery-D4IZU_Co.d.cts} +3 -3
- package/dist/{SuspenseQuery-BKoPQQ_o.d.cts.map → SuspenseQuery-D4IZU_Co.d.cts.map} +1 -1
- package/dist/{SuspenseQuery--nIIoDt1.cjs → SuspenseQuery-DE4NKrqP.cjs} +2 -2
- package/dist/{SuspenseQuery--nIIoDt1.cjs.map → SuspenseQuery-DE4NKrqP.cjs.map} +1 -1
- package/dist/{SuspenseQuery-BKoPQQ_o.d.cts → SuspenseQuery-VjYG_b1z.d.mts} +3 -3
- package/dist/{SuspenseQuery-BZ20Rsoo.d.mts.map → SuspenseQuery-VjYG_b1z.d.mts.map} +1 -1
- package/dist/SuspenseQuery.cjs +1 -1
- package/dist/SuspenseQuery.d.cts +1 -1
- package/dist/SuspenseQuery.d.mts +1 -1
- package/dist/SuspenseQuery.mjs +1 -1
- package/dist/components/ClientOnly.d.mts +2 -2
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +9 -9
- package/dist/index.d.mts +8 -8
- package/dist/index.mjs +5 -5
- package/package.json +1 -1
- package/src/IsFetching.spec.tsx +34 -0
- package/src/IsFetching.tsx +3 -1
- package/dist/IsFetching-94upYqWP.mjs +0 -12
- package/dist/IsFetching-94upYqWP.mjs.map +0 -1
- package/dist/IsFetching-BGIRMA6C.cjs +0 -17
- package/dist/IsFetching-BGIRMA6C.cjs.map +0 -1
- package/dist/IsFetching-CThOxeZB.d.cts.map +0 -1
- package/dist/IsFetching-D3xmE2Kn.d.mts.map +0 -1
- /package/dist/{objectWithoutProperties-Drlt06jT.mjs → objectWithoutProperties-BYP50gyF.mjs} +0 -0
- /package/dist/{objectWithoutProperties-BqF6LYLG.cjs → objectWithoutProperties-CYXRK7DS.cjs} +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { t as _objectWithoutProperties } from "./objectWithoutProperties-BYP50gyF.mjs";
|
|
2
|
+
import { useIsFetching } from "@tanstack/react-query";
|
|
3
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/IsFetching.tsx
|
|
6
|
+
const _excluded = ["children"];
|
|
7
|
+
/**
|
|
8
|
+
* Renders the current fetching count for queries that match the given filters.
|
|
9
|
+
* @experimental This is an experimental feature.
|
|
10
|
+
*/
|
|
11
|
+
const IsFetching = (_ref) => {
|
|
12
|
+
let { children } = _ref;
|
|
13
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(useIsFetching(_objectWithoutProperties(_ref, _excluded))) });
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { IsFetching as t };
|
|
18
|
+
//# sourceMappingURL=IsFetching-BYkNw1cs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IsFetching-BYkNw1cs.mjs","names":[],"sources":["../src/IsFetching.tsx"],"sourcesContent":["'use client'\n\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":";;;;;mBAUE;;;;;AADF,MAAa,cAAc,SAGqE;KAHrE,EACzB;AAE8F,QAC9F,0CAAG,SAAS,wDAAqB,CAAC,GAAI"}
|
|
@@ -3,14 +3,17 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/IsFetching.d.ts
|
|
6
|
+
|
|
6
7
|
/**
|
|
8
|
+
* Renders the current fetching count for queries that match the given filters.
|
|
7
9
|
* @experimental This is an experimental feature.
|
|
8
10
|
*/
|
|
9
11
|
declare const IsFetching: ({
|
|
10
|
-
children
|
|
12
|
+
children,
|
|
13
|
+
...filter
|
|
11
14
|
}: QueryFilters & {
|
|
12
15
|
children: (isFetching: ReturnType<typeof useIsFetching>) => ReactNode;
|
|
13
16
|
}) => react_jsx_runtime0.JSX.Element;
|
|
14
17
|
//#endregion
|
|
15
18
|
export { IsFetching as t };
|
|
16
|
-
//# sourceMappingURL=IsFetching-
|
|
19
|
+
//# sourceMappingURL=IsFetching-BfIQ3Qek.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IsFetching-BfIQ3Qek.d.mts","names":[],"sources":["../src/IsFetching.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AASA;AAA2B,cAAd,UAAc,EAAA,CAAA;EAAA,QAAA;EAAA,GAAA;CAAA,EAGxB,YAHwB,GAAA;EAGxB,QAAA,EAAA,CAAA,UAAA,EAAwC,UAAxC,CAAA,OAA0D,aAA1D,CAAA,EAAA,GAA6E,SAA7E;CAA0D,EAAA,GAA8B,kBAAA,CAAA,GAAA,CAAA,OAA9B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const require_objectWithoutProperties = require('./objectWithoutProperties-CYXRK7DS.cjs');
|
|
2
|
+
let __tanstack_react_query = require("@tanstack/react-query");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
|
|
5
|
+
//#region src/IsFetching.tsx
|
|
6
|
+
const _excluded = ["children"];
|
|
7
|
+
/**
|
|
8
|
+
* Renders the current fetching count for queries that match the given filters.
|
|
9
|
+
* @experimental This is an experimental feature.
|
|
10
|
+
*/
|
|
11
|
+
const IsFetching = (_ref) => {
|
|
12
|
+
let { children } = _ref;
|
|
13
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: children((0, __tanstack_react_query.useIsFetching)(require_objectWithoutProperties._objectWithoutProperties(_ref, _excluded))) });
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
Object.defineProperty(exports, 'IsFetching', {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return IsFetching;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=IsFetching-BhOgGqrs.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IsFetching-BhOgGqrs.cjs","names":[],"sources":["../src/IsFetching.tsx"],"sourcesContent":["'use client'\n\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":";;;;;mBAUE;;;;;AADF,MAAa,cAAc,SAGqE;KAHrE,EACzB;AAE8F,QAC9F,mFAAG,6HAA8B,CAAC,GAAI"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
2
2
|
import { QueryFilters, useIsFetching } from "@tanstack/react-query";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/IsFetching.d.ts
|
|
6
|
+
|
|
6
7
|
/**
|
|
8
|
+
* Renders the current fetching count for queries that match the given filters.
|
|
7
9
|
* @experimental This is an experimental feature.
|
|
8
10
|
*/
|
|
9
11
|
declare const IsFetching: ({
|
|
10
|
-
children
|
|
12
|
+
children,
|
|
13
|
+
...filter
|
|
11
14
|
}: QueryFilters & {
|
|
12
15
|
children: (isFetching: ReturnType<typeof useIsFetching>) => ReactNode;
|
|
13
|
-
}) =>
|
|
16
|
+
}) => react_jsx_runtime8.JSX.Element;
|
|
14
17
|
//#endregion
|
|
15
18
|
export { IsFetching as t };
|
|
16
|
-
//# sourceMappingURL=IsFetching-
|
|
19
|
+
//# sourceMappingURL=IsFetching-CuftXnaJ.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IsFetching-CuftXnaJ.d.cts","names":[],"sources":["../src/IsFetching.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AASA;AAA2B,cAAd,UAAc,EAAA,CAAA;EAAA,QAAA;EAAA,GAAA;CAAA,EAGxB,YAHwB,GAAA;EAGxB,QAAA,EAAA,CAAA,UAAA,EAAwC,UAAxC,CAAA,OAA0D,aAA1D,CAAA,EAAA,GAA6E,SAA7E;CAA0D,EAAA,GAA8B,kBAAA,CAAA,GAAA,CAAA,OAA9B"}
|
package/dist/IsFetching.cjs
CHANGED
package/dist/IsFetching.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as IsFetching } from "./IsFetching-
|
|
1
|
+
import { t as IsFetching } from "./IsFetching-CuftXnaJ.cjs";
|
|
2
2
|
export { IsFetching };
|
package/dist/IsFetching.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as IsFetching } from "./IsFetching-
|
|
1
|
+
import { t as IsFetching } from "./IsFetching-BfIQ3Qek.mjs";
|
|
2
2
|
export { IsFetching };
|
package/dist/IsFetching.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_objectWithoutProperties = require('./objectWithoutProperties-
|
|
1
|
+
const require_objectWithoutProperties = require('./objectWithoutProperties-CYXRK7DS.cjs');
|
|
2
2
|
let __tanstack_react_query = require("@tanstack/react-query");
|
|
3
3
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
4
|
|
|
@@ -16,4 +16,4 @@ Object.defineProperty(exports, 'Mutation', {
|
|
|
16
16
|
return Mutation;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
//# sourceMappingURL=Mutation-
|
|
19
|
+
//# sourceMappingURL=Mutation-CGUYEkKX.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mutation-
|
|
1
|
+
{"version":3,"file":"Mutation-CGUYEkKX.cjs","names":[],"sources":["../src/Mutation.tsx"],"sourcesContent":["'use client'\n\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":";;;;;mBAME;AADF,SAAgB,SAAmF,MAKhG;KALgG,EACjG;AAKA,QAAO,mFAAG,2HAA6B,CAAC,GAAI"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime6 from "react/jsx-runtime";
|
|
2
2
|
import { UseMutationOptions, UseMutationResult } from "@tanstack/react-query";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ declare function Mutation<TData = unknown, TError = unknown, TVariables = void,
|
|
|
8
8
|
...options
|
|
9
9
|
}: UseMutationOptions<TData, TError, TVariables, TContext> & {
|
|
10
10
|
children: (mutationResult: UseMutationResult<TData, TError, TVariables, TContext>) => ReactNode;
|
|
11
|
-
}):
|
|
11
|
+
}): react_jsx_runtime6.JSX.Element;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { Mutation as t };
|
|
14
|
-
//# sourceMappingURL=Mutation-
|
|
14
|
+
//# sourceMappingURL=Mutation-DGmP7HQI.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mutation-
|
|
1
|
+
{"version":3,"file":"Mutation-DGmP7HQI.d.cts","names":[],"sources":["../src/Mutation.tsx"],"sourcesContent":[],"mappings":";;;;;iBAKgB;;;GAGb,mBAAmB,OAAO,QAAQ,YAAY;6BACpB,kBAAkB,OAAO,QAAQ,YAAY,cAAc;IACvF,kBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as _objectWithoutProperties } from "./objectWithoutProperties-
|
|
1
|
+
import { t as _objectWithoutProperties } from "./objectWithoutProperties-BYP50gyF.mjs";
|
|
2
2
|
import { useMutation } from "@tanstack/react-query";
|
|
3
3
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -11,4 +11,4 @@ function Mutation(_ref) {
|
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
13
|
export { Mutation as t };
|
|
14
|
-
//# sourceMappingURL=Mutation-
|
|
14
|
+
//# sourceMappingURL=Mutation-DUJhz3rT.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mutation-
|
|
1
|
+
{"version":3,"file":"Mutation-DUJhz3rT.mjs","names":[],"sources":["../src/Mutation.tsx"],"sourcesContent":["'use client'\n\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":";;;;;mBAME;AADF,SAAgB,SAAmF,MAKhG;KALgG,EACjG;AAKA,QAAO,0CAAG,SAAS,sDAAoB,CAAC,GAAI"}
|
package/dist/Mutation.cjs
CHANGED
package/dist/Mutation.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Mutation } from "./Mutation-
|
|
1
|
+
import { t as Mutation } from "./Mutation-DGmP7HQI.cjs";
|
|
2
2
|
export { Mutation };
|
package/dist/Mutation.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
1
2
|
import { FetchInfiniteQueryOptions, QueryKey } from "@tanstack/react-query";
|
|
2
|
-
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/PrefetchInfiniteQuery.d.ts
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
|
11
11
|
* <PrefetchInfiniteQuery queryKey={['queryKey']} queryFn={queryFn} />
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
declare function PrefetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>):
|
|
14
|
+
declare function PrefetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>): react_jsx_runtime0.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { PrefetchInfiniteQuery as t };
|
|
17
|
-
//# sourceMappingURL=PrefetchInfiniteQuery-
|
|
17
|
+
//# sourceMappingURL=PrefetchInfiniteQuery-BewcG5rR.d.cts.map
|
package/dist/{PrefetchInfiniteQuery-DgZfL2Sb.d.cts.map → PrefetchInfiniteQuery-BewcG5rR.d.cts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrefetchInfiniteQuery-
|
|
1
|
+
{"version":3,"file":"PrefetchInfiniteQuery-BewcG5rR.d.cts","names":[],"sources":["../src/PrefetchInfiniteQuery.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAaA;;;;;AAKmD,iBALnC,qBAKmC,CAAA,eAAA,OAAA,EAAA,SAAA,OAAA,EAAA,QAFzC,YAEyC,EAAA,kBAD/B,QAC+B,GADpB,QACoB,CAAA,CAAA,OAAA,EAAxC,yBAAwC,CAAd,YAAc,EAAA,MAAA,EAAQ,KAAR,EAAe,SAAf,CAAA,CAAA,EAAyB,kBAAA,CAAA,GAAA,CAAA,OAAzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
2
1
|
import { FetchInfiniteQueryOptions, QueryKey } from "@tanstack/react-query";
|
|
2
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/PrefetchInfiniteQuery.d.ts
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ import { FetchInfiniteQueryOptions, QueryKey } from "@tanstack/react-query";
|
|
|
11
11
|
* <PrefetchInfiniteQuery queryKey={['queryKey']} queryFn={queryFn} />
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
declare function PrefetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>):
|
|
14
|
+
declare function PrefetchInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey>): react_jsx_runtime4.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { PrefetchInfiniteQuery as t };
|
|
17
|
-
//# sourceMappingURL=PrefetchInfiniteQuery-
|
|
17
|
+
//# sourceMappingURL=PrefetchInfiniteQuery-D-3dZMEz.d.mts.map
|
package/dist/{PrefetchInfiniteQuery-Dzjm5lf8.d.mts.map → PrefetchInfiniteQuery-D-3dZMEz.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrefetchInfiniteQuery-
|
|
1
|
+
{"version":3,"file":"PrefetchInfiniteQuery-D-3dZMEz.d.mts","names":[],"sources":["../src/PrefetchInfiniteQuery.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAaA;;;;;AAKmD,iBALnC,qBAKmC,CAAA,eAAA,OAAA,EAAA,SAAA,OAAA,EAAA,QAFzC,YAEyC,EAAA,kBAD/B,QAC+B,GADpB,QACoB,CAAA,CAAA,OAAA,EAAxC,yBAAwC,CAAd,YAAc,EAAA,MAAA,EAAQ,KAAR,EAAe,SAAf,CAAA,CAAA,EAAyB,kBAAA,CAAA,GAAA,CAAA,OAAzB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as PrefetchInfiniteQuery } from "./PrefetchInfiniteQuery-
|
|
1
|
+
import { t as PrefetchInfiniteQuery } from "./PrefetchInfiniteQuery-BewcG5rR.cjs";
|
|
2
2
|
export { PrefetchInfiniteQuery };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as PrefetchInfiniteQuery } from "./PrefetchInfiniteQuery-
|
|
1
|
+
import { t as PrefetchInfiniteQuery } from "./PrefetchInfiniteQuery-D-3dZMEz.mjs";
|
|
2
2
|
export { PrefetchInfiniteQuery };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
import { FetchQueryOptions, QueryKey } from "@tanstack/react-query";
|
|
3
3
|
|
|
4
4
|
//#region src/PrefetchQuery.d.ts
|
|
@@ -11,7 +11,7 @@ import { FetchQueryOptions, QueryKey } from "@tanstack/react-query";
|
|
|
11
11
|
* <PrefetchQuery queryKey={['queryKey']} queryFn={queryFn} />
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
declare function PrefetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>):
|
|
14
|
+
declare function PrefetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): react_jsx_runtime0.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { PrefetchQuery as t };
|
|
17
|
-
//# sourceMappingURL=PrefetchQuery-
|
|
17
|
+
//# sourceMappingURL=PrefetchQuery-Ddbt43Fk.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrefetchQuery-
|
|
1
|
+
{"version":3,"file":"PrefetchQuery-Ddbt43Fk.d.cts","names":[],"sources":["../src/PrefetchQuery.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAaA;;;;;AAK2C,iBAL3B,aAK2B,CAAA,eAAA,OAAA,EAAA,SAAA,OAAA,EAAA,QAFjC,YAEiC,EAAA,kBADvB,QACuB,GADZ,QACY,CAAA,CAAA,OAAA,EAAhC,iBAAgC,CAAd,YAAc,EAAA,MAAA,EAAQ,KAAR,EAAe,SAAf,CAAA,CAAA,EAAyB,kBAAA,CAAA,GAAA,CAAA,OAAzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FetchQueryOptions, QueryKey } from "@tanstack/react-query";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime8 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/PrefetchQuery.d.ts
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
|
11
11
|
* <PrefetchQuery queryKey={['queryKey']} queryFn={queryFn} />
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
declare function PrefetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>):
|
|
14
|
+
declare function PrefetchQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: FetchQueryOptions<TQueryFnData, TError, TData, TQueryKey>): react_jsx_runtime8.JSX.Element;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { PrefetchQuery as t };
|
|
17
|
-
//# sourceMappingURL=PrefetchQuery-
|
|
17
|
+
//# sourceMappingURL=PrefetchQuery-DqgbVdjY.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrefetchQuery-
|
|
1
|
+
{"version":3,"file":"PrefetchQuery-DqgbVdjY.d.mts","names":[],"sources":["../src/PrefetchQuery.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAaA;;;;;AAK2C,iBAL3B,aAK2B,CAAA,eAAA,OAAA,EAAA,SAAA,OAAA,EAAA,QAFjC,YAEiC,EAAA,kBADvB,QACuB,GADZ,QACY,CAAA,CAAA,OAAA,EAAhC,iBAAgC,CAAd,YAAc,EAAA,MAAA,EAAQ,KAAR,EAAe,SAAf,CAAA,CAAA,EAAyB,kBAAA,CAAA,GAAA,CAAA,OAAzB"}
|
package/dist/PrefetchQuery.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as PrefetchQuery } from "./PrefetchQuery-
|
|
1
|
+
import { t as PrefetchQuery } from "./PrefetchQuery-Ddbt43Fk.cjs";
|
|
2
2
|
export { PrefetchQuery };
|
package/dist/PrefetchQuery.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as PrefetchQuery } from "./PrefetchQuery-
|
|
1
|
+
import { t as PrefetchQuery } from "./PrefetchQuery-DqgbVdjY.mjs";
|
|
2
2
|
export { PrefetchQuery };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
2
1
|
import { HydrateProps, OmitKeyof, QueryClient, QueryOptions, UseInfiniteQueryOptions, WithRequired } from "@tanstack/react-query";
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/QueriesHydration.d.ts
|
|
@@ -100,7 +100,7 @@ declare function QueriesHydration({
|
|
|
100
100
|
* When not set, no timeout is applied.
|
|
101
101
|
*/
|
|
102
102
|
timeout?: number;
|
|
103
|
-
} & OmitKeyof<HydrateProps, 'state'>): Promise<
|
|
103
|
+
} & OmitKeyof<HydrateProps, 'state'>): Promise<react_jsx_runtime2.JSX.Element>;
|
|
104
104
|
//#endregion
|
|
105
105
|
export { QueriesHydration as t };
|
|
106
|
-
//# sourceMappingURL=QueriesHydration-
|
|
106
|
+
//# sourceMappingURL=QueriesHydration-DPogKsc4.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueriesHydration-
|
|
1
|
+
{"version":3,"file":"QueriesHydration-DPogKsc4.d.mts","names":[],"sources":["../src/QueriesHydration.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AA6EA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAsB,gBAAA;;;;;;;;;;;gBAWN;;;;;YAMV,aAAa,gDACb,aAAa;;;;;;;;cAWD;;;;;;;;IAQd,UAAU,yBAAsB,QAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
1
2
|
import { HydrateProps, OmitKeyof, QueryClient, QueryOptions, UseInfiniteQueryOptions, WithRequired } from "@tanstack/react-query";
|
|
2
|
-
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/QueriesHydration.d.ts
|
|
@@ -100,7 +100,7 @@ declare function QueriesHydration({
|
|
|
100
100
|
* When not set, no timeout is applied.
|
|
101
101
|
*/
|
|
102
102
|
timeout?: number;
|
|
103
|
-
} & OmitKeyof<HydrateProps, 'state'>): Promise<
|
|
103
|
+
} & OmitKeyof<HydrateProps, 'state'>): Promise<react_jsx_runtime1.JSX.Element>;
|
|
104
104
|
//#endregion
|
|
105
105
|
export { QueriesHydration as t };
|
|
106
|
-
//# sourceMappingURL=QueriesHydration-
|
|
106
|
+
//# sourceMappingURL=QueriesHydration-DnlRrHJ3.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueriesHydration-
|
|
1
|
+
{"version":3,"file":"QueriesHydration-DnlRrHJ3.d.cts","names":[],"sources":["../src/QueriesHydration.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;AA6EA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAsB,gBAAA;;;;;;;;;;;gBAWN;;;;;YAMV,aAAa,gDACb,aAAa;;;;;;;;cAWD;;;;;;;;IAQd,UAAU,yBAAsB,QAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as _objectWithoutProperties } from "./objectWithoutProperties-
|
|
1
|
+
import { t as _objectWithoutProperties } from "./objectWithoutProperties-BYP50gyF.mjs";
|
|
2
2
|
import { t as ClientOnly } from "./ClientOnly-BdmzVYnI.mjs";
|
|
3
3
|
import { t as _objectSpread2 } from "./objectSpread2-BFPIJj0i.mjs";
|
|
4
4
|
import { Hydrate, QueryClient, dehydrate } from "@tanstack/react-query";
|
|
@@ -140,4 +140,4 @@ const createTimeoutController = (ms, errorMessage) => {
|
|
|
140
140
|
|
|
141
141
|
//#endregion
|
|
142
142
|
export { QueriesHydration as t };
|
|
143
|
-
//# sourceMappingURL=QueriesHydration-
|
|
143
|
+
//# sourceMappingURL=QueriesHydration-GQxJe_Vu.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueriesHydration-
|
|
1
|
+
{"version":3,"file":"QueriesHydration-GQxJe_Vu.mjs","names":["timerId: ReturnType<typeof setTimeout> | undefined"],"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;IAAW,UAAU,mBAAmB,OAAO,SAAY,eAAe;IAAW;KAAsB;;AAIlH,SACE,oBAAC,2CAAY;GAAO,OAAO,UAAU,YAAY;GAC9C;KACO;;;;AAId,MAAM,2BAA2B,IAAY,iBAAyB;CACpE,IAAIA;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,4 +1,4 @@
|
|
|
1
|
-
const require_objectWithoutProperties = require('./objectWithoutProperties-
|
|
1
|
+
const require_objectWithoutProperties = require('./objectWithoutProperties-CYXRK7DS.cjs');
|
|
2
2
|
const require_ClientOnly = require('./ClientOnly-Dvf8t__-.cjs');
|
|
3
3
|
const require_objectSpread2 = require('./objectSpread2-CpqxxdM2.cjs');
|
|
4
4
|
let __tanstack_react_query = require("@tanstack/react-query");
|
|
@@ -145,4 +145,4 @@ Object.defineProperty(exports, 'QueriesHydration', {
|
|
|
145
145
|
return QueriesHydration;
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
|
-
//# sourceMappingURL=QueriesHydration-
|
|
148
|
+
//# sourceMappingURL=QueriesHydration-dcSAzQNT.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueriesHydration-
|
|
1
|
+
{"version":3,"file":"QueriesHydration-dcSAzQNT.cjs","names":["QueryClient","ClientOnly","Hydrate","timerId: ReturnType<typeof setTimeout> | undefined"],"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,IAAIA,oCAAa,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;IAAW,UAAU,mBAAmB,OAAO,SAAY,eAAe;IAAW;KAAsB;;AAIlH,SACE,2CAACC,8GAAY;GAAO,6CAAiB,YAAY;GAC9C;KACO;;;;AAId,MAAM,2BAA2B,IAAY,iBAAyB;CACpE,IAAIC;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,2 +1,2 @@
|
|
|
1
|
-
import { t as QueriesHydration } from "./QueriesHydration-
|
|
1
|
+
import { t as QueriesHydration } from "./QueriesHydration-DnlRrHJ3.cjs";
|
|
2
2
|
export { QueriesHydration };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as QueriesHydration } from "./QueriesHydration-
|
|
1
|
+
import { t as QueriesHydration } from "./QueriesHydration-DPogKsc4.mjs";
|
|
2
2
|
export { QueriesHydration };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
2
1
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
3
3
|
import { Context, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/QueryClientConsumer.d.ts
|
|
@@ -15,4 +15,4 @@ declare function QueryClientConsumer({
|
|
|
15
15
|
}): react_jsx_runtime3.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { QueryClientConsumer as t };
|
|
18
|
-
//# sourceMappingURL=QueryClientConsumer-
|
|
18
|
+
//# sourceMappingURL=QueryClientConsumer-5PZLv_8g.d.mts.map
|
package/dist/{QueryClientConsumer-D3h25GmM.d.cts.map → QueryClientConsumer-5PZLv_8g.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryClientConsumer-
|
|
1
|
+
{"version":3,"file":"QueryClientConsumer-5PZLv_8g.d.mts","names":[],"sources":["../src/QueryClientConsumer.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAQgB,iBAAA,mBAAA,CAAmB;EAAA,QAAA;EAAA;CAAA,EAAA;EACjC,QAAA,EAAA,CAAA,WAAA,EAGwB,WAHxB,EAAA,GAGwC,SAHxC;EACA,OAAA,CAAA,EAGU,OAHV,CAGkB,WAHlB,GAAA,SAAA,CAAA;CAEwB,CAAA,EAEzB,kBAAA,CAAA,GAAA,CAAA,OAFyB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
1
2
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
|
-
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
3
3
|
import { Context, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/QueryClientConsumer.d.ts
|
|
@@ -12,7 +12,7 @@ declare function QueryClientConsumer({
|
|
|
12
12
|
}: {
|
|
13
13
|
children: (queryClient: QueryClient) => ReactNode;
|
|
14
14
|
context?: Context<QueryClient | undefined>;
|
|
15
|
-
}):
|
|
15
|
+
}): react_jsx_runtime2.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { QueryClientConsumer as t };
|
|
18
|
-
//# sourceMappingURL=QueryClientConsumer-
|
|
18
|
+
//# sourceMappingURL=QueryClientConsumer-pihgMOoA.d.cts.map
|
package/dist/{QueryClientConsumer-DNkucS1e.d.mts.map → QueryClientConsumer-pihgMOoA.d.cts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryClientConsumer-
|
|
1
|
+
{"version":3,"file":"QueryClientConsumer-pihgMOoA.d.cts","names":[],"sources":["../src/QueryClientConsumer.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAQgB,iBAAA,mBAAA,CAAmB;EAAA,QAAA;EAAA;CAAA,EAAA;EACjC,QAAA,EAAA,CAAA,WAAA,EAGwB,WAHxB,EAAA,GAGwC,SAHxC;EACA,OAAA,CAAA,EAGU,OAHV,CAGkB,WAHlB,GAAA,SAAA,CAAA;CAEwB,CAAA,EAEzB,kBAAA,CAAA,GAAA,CAAA,OAFyB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as QueryClientConsumer } from "./QueryClientConsumer-
|
|
1
|
+
import { t as QueryClientConsumer } from "./QueryClientConsumer-pihgMOoA.cjs";
|
|
2
2
|
export { QueryClientConsumer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as QueryClientConsumer } from "./QueryClientConsumer-
|
|
1
|
+
import { t as QueryClientConsumer } from "./QueryClientConsumer-5PZLv_8g.mjs";
|
|
2
2
|
export { QueryClientConsumer };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as _objectWithoutProperties } from "./objectWithoutProperties-
|
|
1
|
+
import { t as _objectWithoutProperties } from "./objectWithoutProperties-BYP50gyF.mjs";
|
|
2
2
|
import { useSuspenseInfiniteQuery } from "@tanstack/react-query";
|
|
3
3
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -27,4 +27,4 @@ const SuspenseInfiniteQuery = (_ref) => {
|
|
|
27
27
|
|
|
28
28
|
//#endregion
|
|
29
29
|
export { SuspenseInfiniteQuery as t };
|
|
30
|
-
//# sourceMappingURL=SuspenseInfiniteQuery-
|
|
30
|
+
//# sourceMappingURL=SuspenseInfiniteQuery-BimBkaCe.mjs.map
|
package/dist/{SuspenseInfiniteQuery-DwW5I_M2.mjs.map → SuspenseInfiniteQuery-BimBkaCe.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuspenseInfiniteQuery-
|
|
1
|
+
{"version":3,"file":"SuspenseInfiniteQuery-BimBkaCe.mjs","names":[],"sources":["../src/SuspenseInfiniteQuery.tsx"],"sourcesContent":["'use client'\n\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":";;;;;mBA2BE;;;;;;;;;;;;;;;;;AANF,MAAa,yBAKX,SAKI;KALJ,EACA;AAII,kDAAG,SAAS,mEAAiC,CAAC,GAAI"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as UseSuspenseInfiniteQueryOptions } from "./useSuspenseInfiniteQuery-Bh0nh8Kc.mjs";
|
|
2
2
|
import { QueryKey, UseSuspenseInfiniteQueryResult } from "@tanstack/react-query";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/SuspenseInfiniteQuery.d.ts
|
|
@@ -26,7 +26,7 @@ declare const SuspenseInfiniteQuery: <TQueryFnData = unknown, TError = unknown,
|
|
|
26
26
|
...options
|
|
27
27
|
}: UseSuspenseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
28
28
|
children: (query: UseSuspenseInfiniteQueryResult<TData, TError>) => ReactNode;
|
|
29
|
-
}) =>
|
|
29
|
+
}) => react_jsx_runtime7.JSX.Element;
|
|
30
30
|
//#endregion
|
|
31
31
|
export { SuspenseInfiniteQuery as t };
|
|
32
|
-
//# sourceMappingURL=SuspenseInfiniteQuery-
|
|
32
|
+
//# sourceMappingURL=SuspenseInfiniteQuery-BtRviR-Z.d.mts.map
|