@suspensive/react-query-4 3.19.1 → 3.19.3
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.cjs +18 -2
- package/dist/IsFetching.cjs.map +1 -0
- package/dist/IsFetching.d.cts +18 -2
- package/dist/IsFetching.d.cts.map +1 -0
- package/dist/IsFetching.d.mts +18 -2
- package/dist/IsFetching.d.mts.map +1 -0
- package/dist/IsFetching.mjs +17 -2
- package/dist/IsFetching.mjs.map +1 -0
- package/dist/Mutation.cjs +14 -2
- package/dist/Mutation.cjs.map +1 -0
- package/dist/Mutation.d.cts +14 -2
- package/dist/Mutation.d.cts.map +1 -0
- package/dist/Mutation.d.mts +14 -2
- package/dist/Mutation.d.mts.map +1 -0
- package/dist/Mutation.mjs +13 -2
- package/dist/Mutation.mjs.map +1 -0
- package/dist/PrefetchInfiniteQuery.cjs +20 -2
- package/dist/PrefetchInfiniteQuery.cjs.map +1 -0
- package/dist/PrefetchInfiniteQuery.d.cts +16 -2
- package/dist/PrefetchInfiniteQuery.d.cts.map +1 -0
- package/dist/PrefetchInfiniteQuery.d.mts +16 -2
- package/dist/PrefetchInfiniteQuery.d.mts.map +1 -0
- package/dist/PrefetchInfiniteQuery.mjs +19 -2
- package/dist/PrefetchInfiniteQuery.mjs.map +1 -0
- package/dist/PrefetchQuery.cjs +20 -2
- package/dist/PrefetchQuery.cjs.map +1 -0
- package/dist/PrefetchQuery.d.cts +16 -2
- package/dist/PrefetchQuery.d.cts.map +1 -0
- package/dist/PrefetchQuery.d.mts +16 -2
- package/dist/PrefetchQuery.d.mts.map +1 -0
- package/dist/PrefetchQuery.mjs +19 -2
- package/dist/PrefetchQuery.mjs.map +1 -0
- package/dist/{QueriesHydration-BYKU-Mte.cjs → QueriesHydration-B9tinfWA.cjs} +16 -16
- package/dist/QueriesHydration-B9tinfWA.cjs.map +1 -0
- package/dist/{QueriesHydration-27lFZeB8.mjs → QueriesHydration-MZQ7Oj60.mjs} +11 -11
- package/dist/QueriesHydration-MZQ7Oj60.mjs.map +1 -0
- package/dist/QueriesHydration.cjs +2 -1
- package/dist/QueriesHydration.d.cts +105 -2
- package/dist/QueriesHydration.d.cts.map +1 -0
- package/dist/QueriesHydration.d.mts +105 -2
- package/dist/QueriesHydration.d.mts.map +1 -0
- package/dist/QueriesHydration.mjs +1 -1
- package/dist/QueryClientConsumer.cjs +14 -2
- package/dist/QueryClientConsumer.cjs.map +1 -0
- package/dist/QueryClientConsumer.d.cts +18 -2
- package/dist/QueryClientConsumer.d.cts.map +1 -0
- package/dist/QueryClientConsumer.d.mts +18 -2
- package/dist/QueryClientConsumer.d.mts.map +1 -0
- package/dist/QueryClientConsumer.mjs +13 -2
- package/dist/QueryClientConsumer.mjs.map +1 -0
- package/dist/SuspenseInfiniteQuery.cjs +30 -2
- package/dist/SuspenseInfiniteQuery.cjs.map +1 -0
- package/dist/SuspenseInfiniteQuery.d.cts +31 -2
- package/dist/SuspenseInfiniteQuery.d.cts.map +1 -0
- package/dist/SuspenseInfiniteQuery.d.mts +31 -3
- package/dist/SuspenseInfiniteQuery.d.mts.map +1 -0
- package/dist/SuspenseInfiniteQuery.mjs +29 -2
- package/dist/SuspenseInfiniteQuery.mjs.map +1 -0
- package/dist/SuspenseQueries.cjs +26 -2
- package/dist/SuspenseQueries.cjs.map +1 -0
- package/dist/SuspenseQueries.d.cts +30 -2
- package/dist/SuspenseQueries.d.cts.map +1 -0
- package/dist/SuspenseQueries.d.mts +30 -2
- package/dist/SuspenseQueries.d.mts.map +1 -0
- package/dist/SuspenseQueries.mjs +25 -2
- package/dist/SuspenseQueries.mjs.map +1 -0
- package/dist/SuspenseQuery.cjs +30 -2
- package/dist/SuspenseQuery.cjs.map +1 -0
- package/dist/SuspenseQuery.d.cts +30 -2
- package/dist/SuspenseQuery.d.cts.map +1 -0
- package/dist/SuspenseQuery.d.mts +30 -2
- package/dist/SuspenseQuery.d.mts.map +1 -0
- package/dist/SuspenseQuery.mjs +29 -2
- package/dist/SuspenseQuery.mjs.map +1 -0
- package/dist/components/ClientOnly.cjs +13 -2
- package/dist/components/ClientOnly.cjs.map +1 -0
- package/dist/components/ClientOnly.d.cts +2 -2
- package/dist/components/ClientOnly.d.cts.map +1 -1
- package/dist/components/ClientOnly.d.mts +2 -2
- package/dist/components/ClientOnly.d.mts.map +1 -1
- package/dist/components/ClientOnly.mjs +12 -2
- package/dist/components/ClientOnly.mjs.map +1 -0
- package/dist/createGetQueryClient.cjs +63 -2
- package/dist/createGetQueryClient.cjs.map +1 -0
- package/dist/createGetQueryClient.d.cts +53 -2
- package/dist/createGetQueryClient.d.cts.map +1 -0
- package/dist/createGetQueryClient.d.mts +53 -2
- package/dist/createGetQueryClient.d.mts.map +1 -0
- package/dist/createGetQueryClient.mjs +62 -2
- package/dist/createGetQueryClient.mjs.map +1 -0
- package/dist/index.cjs +19 -18
- package/dist/index.d.cts +18 -18
- package/dist/index.d.mts +18 -18
- package/dist/index.mjs +18 -18
- package/dist/infiniteQueryOptions.cjs +17 -2
- package/dist/infiniteQueryOptions.cjs.map +1 -0
- package/dist/infiniteQueryOptions.d.cts +28 -2
- package/dist/infiniteQueryOptions.d.cts.map +1 -0
- package/dist/infiniteQueryOptions.d.mts +28 -2
- package/dist/infiniteQueryOptions.d.mts.map +1 -0
- package/dist/infiniteQueryOptions.mjs +16 -2
- package/dist/infiniteQueryOptions.mjs.map +1 -0
- package/dist/mutationOptions.cjs +9 -2
- package/dist/mutationOptions.cjs.map +1 -0
- package/dist/mutationOptions.d.cts +7 -2
- package/dist/mutationOptions.d.cts.map +1 -0
- package/dist/mutationOptions.d.mts +7 -2
- package/dist/mutationOptions.d.mts.map +1 -0
- package/dist/mutationOptions.mjs +7 -2
- package/dist/mutationOptions.mjs.map +1 -0
- package/dist/{objectSpread2-CpqxxdM2.cjs → objectSpread2-9HkiXZY2.cjs} +15 -15
- package/dist/{objectSpread2-BFPIJj0i.mjs → objectSpread2-BX3M3dlG.mjs} +15 -15
- package/dist/{objectWithoutProperties-Drlt06jT.mjs → objectWithoutProperties-CZk5Qmfh.mjs} +2 -2
- package/dist/{objectWithoutProperties-BqF6LYLG.cjs → objectWithoutProperties-CfjOeCpP.cjs} +2 -2
- package/dist/queryOptions.cjs +17 -2
- package/dist/queryOptions.cjs.map +1 -0
- package/dist/queryOptions.d.cts +28 -2
- package/dist/queryOptions.d.cts.map +1 -0
- package/dist/queryOptions.d.mts +28 -2
- package/dist/queryOptions.d.mts.map +1 -0
- package/dist/queryOptions.mjs +16 -2
- package/dist/queryOptions.mjs.map +1 -0
- package/dist/usePrefetchInfiniteQuery.cjs +15 -2
- package/dist/usePrefetchInfiniteQuery.cjs.map +1 -0
- package/dist/usePrefetchInfiniteQuery.d.cts +11 -2
- package/dist/usePrefetchInfiniteQuery.d.cts.map +1 -0
- package/dist/usePrefetchInfiniteQuery.d.mts +11 -2
- package/dist/usePrefetchInfiniteQuery.d.mts.map +1 -0
- package/dist/usePrefetchInfiniteQuery.mjs +14 -2
- package/dist/usePrefetchInfiniteQuery.mjs.map +1 -0
- package/dist/usePrefetchQuery.cjs +15 -2
- package/dist/usePrefetchQuery.cjs.map +1 -0
- package/dist/usePrefetchQuery.d.cts +11 -2
- package/dist/usePrefetchQuery.d.cts.map +1 -0
- package/dist/usePrefetchQuery.d.mts +11 -2
- package/dist/usePrefetchQuery.d.mts.map +1 -0
- package/dist/usePrefetchQuery.mjs +14 -2
- package/dist/usePrefetchQuery.mjs.map +1 -0
- package/dist/useSuspenseInfiniteQuery.cjs +17 -2
- package/dist/useSuspenseInfiniteQuery.cjs.map +1 -0
- package/dist/useSuspenseInfiniteQuery.d.cts +17 -2
- package/dist/useSuspenseInfiniteQuery.d.cts.map +1 -0
- package/dist/useSuspenseInfiniteQuery.d.mts +17 -2
- package/dist/useSuspenseInfiniteQuery.d.mts.map +1 -0
- package/dist/useSuspenseInfiniteQuery.mjs +16 -2
- package/dist/useSuspenseInfiniteQuery.mjs.map +1 -0
- package/dist/useSuspenseQueries.cjs +17 -2
- package/dist/useSuspenseQueries.cjs.map +1 -0
- package/dist/useSuspenseQueries.d.cts +36 -2
- package/dist/useSuspenseQueries.d.cts.map +1 -0
- package/dist/useSuspenseQueries.d.mts +36 -2
- package/dist/useSuspenseQueries.d.mts.map +1 -0
- package/dist/useSuspenseQueries.mjs +16 -2
- package/dist/useSuspenseQueries.mjs.map +1 -0
- package/dist/useSuspenseQuery.cjs +17 -2
- package/dist/useSuspenseQuery.cjs.map +1 -0
- package/dist/useSuspenseQuery.d.cts +36 -2
- package/dist/useSuspenseQuery.d.cts.map +1 -0
- package/dist/useSuspenseQuery.d.mts +36 -2
- package/dist/useSuspenseQuery.d.mts.map +1 -0
- package/dist/useSuspenseQuery.mjs +16 -2
- package/dist/useSuspenseQuery.mjs.map +1 -0
- package/package.json +4 -4
- package/src/IsFetching.spec.tsx +34 -0
- package/src/IsFetching.tsx +3 -1
- package/src/createGetQueryClient.spec.tsx +25 -77
- package/dist/ClientOnly-BdmzVYnI.mjs +0 -15
- package/dist/ClientOnly-BdmzVYnI.mjs.map +0 -1
- package/dist/ClientOnly-Dvf8t__-.cjs +0 -20
- package/dist/ClientOnly-Dvf8t__-.cjs.map +0 -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 +0 -16
- package/dist/IsFetching-CThOxeZB.d.cts.map +0 -1
- package/dist/IsFetching-D3xmE2Kn.d.mts +0 -16
- package/dist/IsFetching-D3xmE2Kn.d.mts.map +0 -1
- package/dist/Mutation-BJunfaUO.mjs +0 -14
- package/dist/Mutation-BJunfaUO.mjs.map +0 -1
- package/dist/Mutation-BWER242k.cjs +0 -19
- package/dist/Mutation-BWER242k.cjs.map +0 -1
- package/dist/Mutation-CGpbCg54.d.mts +0 -14
- package/dist/Mutation-CGpbCg54.d.mts.map +0 -1
- package/dist/Mutation-Dt5kUsd8.d.cts +0 -14
- package/dist/Mutation-Dt5kUsd8.d.cts.map +0 -1
- package/dist/PrefetchInfiniteQuery-DgZfL2Sb.d.cts +0 -17
- package/dist/PrefetchInfiniteQuery-DgZfL2Sb.d.cts.map +0 -1
- package/dist/PrefetchInfiniteQuery-Dzjm5lf8.d.mts +0 -17
- package/dist/PrefetchInfiniteQuery-Dzjm5lf8.d.mts.map +0 -1
- package/dist/PrefetchInfiniteQuery-RS3Qz-7B.mjs +0 -20
- package/dist/PrefetchInfiniteQuery-RS3Qz-7B.mjs.map +0 -1
- package/dist/PrefetchInfiniteQuery-cCSXqKVR.cjs +0 -25
- package/dist/PrefetchInfiniteQuery-cCSXqKVR.cjs.map +0 -1
- package/dist/PrefetchQuery-0pdYNtpS.cjs +0 -25
- package/dist/PrefetchQuery-0pdYNtpS.cjs.map +0 -1
- package/dist/PrefetchQuery-CeQ0yxDL.d.cts +0 -17
- package/dist/PrefetchQuery-CeQ0yxDL.d.cts.map +0 -1
- package/dist/PrefetchQuery-DAqAWOeP.d.mts +0 -17
- package/dist/PrefetchQuery-DAqAWOeP.d.mts.map +0 -1
- package/dist/PrefetchQuery-uh4idoXK.mjs +0 -20
- package/dist/PrefetchQuery-uh4idoXK.mjs.map +0 -1
- package/dist/QueriesHydration-27lFZeB8.mjs.map +0 -1
- package/dist/QueriesHydration-B89HKn9y.d.cts +0 -106
- package/dist/QueriesHydration-B89HKn9y.d.cts.map +0 -1
- package/dist/QueriesHydration-BYKU-Mte.cjs.map +0 -1
- package/dist/QueriesHydration-BeMkJU3l.d.mts +0 -106
- package/dist/QueriesHydration-BeMkJU3l.d.mts.map +0 -1
- package/dist/QueryClientConsumer-D3h25GmM.d.cts +0 -18
- package/dist/QueryClientConsumer-D3h25GmM.d.cts.map +0 -1
- package/dist/QueryClientConsumer-DNkucS1e.d.mts +0 -18
- package/dist/QueryClientConsumer-DNkucS1e.d.mts.map +0 -1
- package/dist/QueryClientConsumer-e7PyaFF3.mjs +0 -14
- package/dist/QueryClientConsumer-e7PyaFF3.mjs.map +0 -1
- package/dist/QueryClientConsumer-mF0OUwkq.cjs +0 -19
- package/dist/QueryClientConsumer-mF0OUwkq.cjs.map +0 -1
- package/dist/SuspenseInfiniteQuery-Bt7GeiHi.d.cts +0 -32
- package/dist/SuspenseInfiniteQuery-Bt7GeiHi.d.cts.map +0 -1
- package/dist/SuspenseInfiniteQuery-CSd2Hyym.d.mts +0 -32
- package/dist/SuspenseInfiniteQuery-CSd2Hyym.d.mts.map +0 -1
- package/dist/SuspenseInfiniteQuery-Dq97Dear.cjs +0 -35
- package/dist/SuspenseInfiniteQuery-Dq97Dear.cjs.map +0 -1
- package/dist/SuspenseInfiniteQuery-DwW5I_M2.mjs +0 -30
- package/dist/SuspenseInfiniteQuery-DwW5I_M2.mjs.map +0 -1
- package/dist/SuspenseQueries-B-UR1dnn.d.cts +0 -31
- package/dist/SuspenseQueries-B-UR1dnn.d.cts.map +0 -1
- package/dist/SuspenseQueries-Brk6gtMw.cjs +0 -31
- package/dist/SuspenseQueries-Brk6gtMw.cjs.map +0 -1
- package/dist/SuspenseQueries-C0mF_XD_.mjs +0 -26
- package/dist/SuspenseQueries-C0mF_XD_.mjs.map +0 -1
- package/dist/SuspenseQueries-CF_WoDIW.d.mts +0 -31
- package/dist/SuspenseQueries-CF_WoDIW.d.mts.map +0 -1
- package/dist/SuspenseQuery--nIIoDt1.cjs +0 -35
- package/dist/SuspenseQuery--nIIoDt1.cjs.map +0 -1
- package/dist/SuspenseQuery-BKoPQQ_o.d.cts +0 -31
- package/dist/SuspenseQuery-BKoPQQ_o.d.cts.map +0 -1
- package/dist/SuspenseQuery-BZ20Rsoo.d.mts +0 -31
- package/dist/SuspenseQuery-BZ20Rsoo.d.mts.map +0 -1
- package/dist/SuspenseQuery-CgN3lrzL.mjs +0 -30
- package/dist/SuspenseQuery-CgN3lrzL.mjs.map +0 -1
- package/dist/createGetQueryClient-B0yrcyXF.mjs +0 -63
- package/dist/createGetQueryClient-B0yrcyXF.mjs.map +0 -1
- package/dist/createGetQueryClient-DTKVVwpJ.d.mts +0 -54
- package/dist/createGetQueryClient-DTKVVwpJ.d.mts.map +0 -1
- package/dist/createGetQueryClient-iXoXO7so.d.cts +0 -54
- package/dist/createGetQueryClient-iXoXO7so.d.cts.map +0 -1
- package/dist/createGetQueryClient-nXvPqrrS.cjs +0 -68
- package/dist/createGetQueryClient-nXvPqrrS.cjs.map +0 -1
- package/dist/infiniteQueryOptions-2KFmTqEY.mjs +0 -17
- package/dist/infiniteQueryOptions-2KFmTqEY.mjs.map +0 -1
- package/dist/infiniteQueryOptions-BVac5B-c.cjs +0 -22
- package/dist/infiniteQueryOptions-BVac5B-c.cjs.map +0 -1
- package/dist/infiniteQueryOptions-Be7VYTUR.d.cts +0 -29
- package/dist/infiniteQueryOptions-Be7VYTUR.d.cts.map +0 -1
- package/dist/infiniteQueryOptions-Bpz4mFYH.d.mts +0 -29
- package/dist/infiniteQueryOptions-Bpz4mFYH.d.mts.map +0 -1
- package/dist/mutationOptions-BIOn3zne.cjs +0 -14
- package/dist/mutationOptions-BIOn3zne.cjs.map +0 -1
- package/dist/mutationOptions-BZS10WEJ.d.mts +0 -7
- package/dist/mutationOptions-BZS10WEJ.d.mts.map +0 -1
- package/dist/mutationOptions-C4emetVL.mjs +0 -8
- package/dist/mutationOptions-C4emetVL.mjs.map +0 -1
- package/dist/mutationOptions-Eid3aM1W.d.cts +0 -7
- package/dist/mutationOptions-Eid3aM1W.d.cts.map +0 -1
- package/dist/queryOptions-92vSd4eV.cjs +0 -22
- package/dist/queryOptions-92vSd4eV.cjs.map +0 -1
- package/dist/queryOptions-DILe-4vk.d.mts +0 -29
- package/dist/queryOptions-DILe-4vk.d.mts.map +0 -1
- package/dist/queryOptions-DNGHeGX5.d.cts +0 -29
- package/dist/queryOptions-DNGHeGX5.d.cts.map +0 -1
- package/dist/queryOptions-Dnf4-wlk.mjs +0 -17
- package/dist/queryOptions-Dnf4-wlk.mjs.map +0 -1
- package/dist/usePrefetchInfiniteQuery-B0_Ladyp.d.mts +0 -12
- package/dist/usePrefetchInfiniteQuery-B0_Ladyp.d.mts.map +0 -1
- package/dist/usePrefetchInfiniteQuery-BmZtlLeD.cjs +0 -20
- package/dist/usePrefetchInfiniteQuery-BmZtlLeD.cjs.map +0 -1
- package/dist/usePrefetchInfiniteQuery-CQSN-P9m.mjs +0 -15
- package/dist/usePrefetchInfiniteQuery-CQSN-P9m.mjs.map +0 -1
- package/dist/usePrefetchInfiniteQuery-CRwRctQH.d.cts +0 -12
- package/dist/usePrefetchInfiniteQuery-CRwRctQH.d.cts.map +0 -1
- package/dist/usePrefetchQuery-38O319FT.d.mts +0 -12
- package/dist/usePrefetchQuery-38O319FT.d.mts.map +0 -1
- package/dist/usePrefetchQuery-93Pltnzl.d.cts +0 -12
- package/dist/usePrefetchQuery-93Pltnzl.d.cts.map +0 -1
- package/dist/usePrefetchQuery-CtrJciA6.mjs +0 -15
- package/dist/usePrefetchQuery-CtrJciA6.mjs.map +0 -1
- package/dist/usePrefetchQuery-woiivAJc.cjs +0 -20
- package/dist/usePrefetchQuery-woiivAJc.cjs.map +0 -1
- package/dist/useSuspenseInfiniteQuery-Bh0nh8Kc.d.mts +0 -17
- package/dist/useSuspenseInfiniteQuery-Bh0nh8Kc.d.mts.map +0 -1
- package/dist/useSuspenseInfiniteQuery-CA0jmgbX.cjs +0 -22
- package/dist/useSuspenseInfiniteQuery-CA0jmgbX.cjs.map +0 -1
- package/dist/useSuspenseInfiniteQuery-DUxKOkCo.mjs +0 -17
- package/dist/useSuspenseInfiniteQuery-DUxKOkCo.mjs.map +0 -1
- package/dist/useSuspenseInfiniteQuery-xXu-A7cX.d.cts +0 -17
- package/dist/useSuspenseInfiniteQuery-xXu-A7cX.d.cts.map +0 -1
- package/dist/useSuspenseQueries-Bf0lSTWB.mjs +0 -17
- package/dist/useSuspenseQueries-Bf0lSTWB.mjs.map +0 -1
- package/dist/useSuspenseQueries-CHPLAyeb.d.cts +0 -37
- package/dist/useSuspenseQueries-CHPLAyeb.d.cts.map +0 -1
- package/dist/useSuspenseQueries-DqBaOI3L.cjs +0 -22
- package/dist/useSuspenseQueries-DqBaOI3L.cjs.map +0 -1
- package/dist/useSuspenseQueries-pfI8hFSM.d.mts +0 -37
- package/dist/useSuspenseQueries-pfI8hFSM.d.mts.map +0 -1
- package/dist/useSuspenseQuery-41ONxa6i.cjs +0 -22
- package/dist/useSuspenseQuery-41ONxa6i.cjs.map +0 -1
- package/dist/useSuspenseQuery-CVWQeHhd.mjs +0 -17
- package/dist/useSuspenseQuery-CVWQeHhd.mjs.map +0 -1
- package/dist/useSuspenseQuery-DG0Jz1Da.d.mts +0 -37
- package/dist/useSuspenseQuery-DG0Jz1Da.d.mts.map +0 -1
- package/dist/useSuspenseQuery-DiNomNWA.d.cts +0 -37
- package/dist/useSuspenseQuery-DiNomNWA.d.cts.map +0 -1
|
@@ -1,2 +1,105 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import { HydrateProps, OmitKeyof, QueryClient, QueryOptions, UseInfiniteQueryOptions, WithRequired } from "@tanstack/react-query";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/QueriesHydration.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* A server component that fetches multiple queries on the server and hydrates them to the client.
|
|
8
|
+
*
|
|
9
|
+
* @experimental This component is experimental and may be changed or removed in the future.
|
|
10
|
+
*
|
|
11
|
+
* @description
|
|
12
|
+
* QueriesHydration is designed for React Server Components (RSC).
|
|
13
|
+
* It pre-fetches multiple queries on the server side and automatically hydrates
|
|
14
|
+
* the data to the client, enabling seamless data synchronization between server and client.
|
|
15
|
+
*
|
|
16
|
+
* When errors occur during server-side fetching, the component gracefully falls back
|
|
17
|
+
* to client-side rendering, ensuring your application remains resilient.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* // app/page.tsx (Server Component)
|
|
22
|
+
* import { Suspense } from 'react'
|
|
23
|
+
* import { QueriesHydration } from '@suspensive/react-query'
|
|
24
|
+
* import { queryOptions } from '@tanstack/react-query'
|
|
25
|
+
*
|
|
26
|
+
* const userQueryOptions = (userId: string) => queryOptions({
|
|
27
|
+
* queryKey: ['user', userId],
|
|
28
|
+
* queryFn: () => fetchUser(userId)
|
|
29
|
+
* })
|
|
30
|
+
*
|
|
31
|
+
* const postsQueryOptions = () => queryOptions({
|
|
32
|
+
* queryKey: ['posts'],
|
|
33
|
+
* queryFn: () => fetchPosts()
|
|
34
|
+
* })
|
|
35
|
+
*
|
|
36
|
+
* export default function Page({ userId }: { userId: string }) {
|
|
37
|
+
* return (
|
|
38
|
+
* <>
|
|
39
|
+
* <Suspense fallback={<div>Loading user...</div>}>
|
|
40
|
+
* <QueriesHydration queries={[userQueryOptions(userId)]}>
|
|
41
|
+
* <UserProfile />
|
|
42
|
+
* </QueriesHydration>
|
|
43
|
+
* </Suspense>
|
|
44
|
+
*
|
|
45
|
+
* <Suspense fallback={<div>Loading posts...</div>}>
|
|
46
|
+
* <QueriesHydration queries={[postsQueryOptions()]}>
|
|
47
|
+
* <PostsList />
|
|
48
|
+
* </QueriesHydration>
|
|
49
|
+
* </Suspense>
|
|
50
|
+
* </>
|
|
51
|
+
* )
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* // With custom error fallback
|
|
58
|
+
* <Suspense fallback={<div>Loading user...</div>}>
|
|
59
|
+
* <QueriesHydration
|
|
60
|
+
* queries={[userQueryOptions(userId)]}
|
|
61
|
+
* skipSsrOnError={{ fallback: <div>Fetching on client...</div> }}
|
|
62
|
+
* >
|
|
63
|
+
* <UserProfile />
|
|
64
|
+
* </QueriesHydration>
|
|
65
|
+
* </Suspense>
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @see {@link https://suspensive.org/docs/react-query/QueriesHydration Documentation}
|
|
69
|
+
*/
|
|
70
|
+
declare function QueriesHydration({
|
|
71
|
+
queries,
|
|
72
|
+
children,
|
|
73
|
+
queryClient,
|
|
74
|
+
skipSsrOnError,
|
|
75
|
+
timeout,
|
|
76
|
+
...props
|
|
77
|
+
}: {
|
|
78
|
+
/**
|
|
79
|
+
* The QueryClient instance to use for fetching queries.
|
|
80
|
+
*/
|
|
81
|
+
queryClient?: QueryClient;
|
|
82
|
+
/**
|
|
83
|
+
* An array of query options or infinite query options to be fetched on the server. Each query must include a `queryKey`.
|
|
84
|
+
* You can mix regular queries and infinite queries in the same array.
|
|
85
|
+
*/
|
|
86
|
+
queries: (WithRequired<QueryOptions<any, any, any, any>, 'queryKey'> | WithRequired<UseInfiniteQueryOptions<any, any, any, any, any>, 'queryKey'>)[];
|
|
87
|
+
/**
|
|
88
|
+
* Controls error handling behavior:
|
|
89
|
+
* - `true` (default): Skips SSR and falls back to client-side rendering when server fetch fails
|
|
90
|
+
* - `false`: Proceeds with SSR without hydration (retry fetching on client component server rendering)
|
|
91
|
+
* - `{ fallback: ReactNode }`: Skips SSR with custom fallback UI during client-side rendering
|
|
92
|
+
*/
|
|
93
|
+
skipSsrOnError?: boolean | {
|
|
94
|
+
fallback: ReactNode;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* The timeout in milliseconds for the query.
|
|
98
|
+
* If the query takes longer than the timeout, it will be considered as an error.
|
|
99
|
+
* When not set, no timeout is applied.
|
|
100
|
+
*/
|
|
101
|
+
timeout?: number;
|
|
102
|
+
} & OmitKeyof<HydrateProps, 'state'>): Promise<react_jsx_runtime0.JSX.Element>;
|
|
103
|
+
//#endregion
|
|
104
|
+
export { QueriesHydration };
|
|
105
|
+
//# sourceMappingURL=QueriesHydration.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,2 +1,105 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { HydrateProps, OmitKeyof, QueryClient, QueryOptions, UseInfiniteQueryOptions, WithRequired } from "@tanstack/react-query";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/QueriesHydration.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* A server component that fetches multiple queries on the server and hydrates them to the client.
|
|
8
|
+
*
|
|
9
|
+
* @experimental This component is experimental and may be changed or removed in the future.
|
|
10
|
+
*
|
|
11
|
+
* @description
|
|
12
|
+
* QueriesHydration is designed for React Server Components (RSC).
|
|
13
|
+
* It pre-fetches multiple queries on the server side and automatically hydrates
|
|
14
|
+
* the data to the client, enabling seamless data synchronization between server and client.
|
|
15
|
+
*
|
|
16
|
+
* When errors occur during server-side fetching, the component gracefully falls back
|
|
17
|
+
* to client-side rendering, ensuring your application remains resilient.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* // app/page.tsx (Server Component)
|
|
22
|
+
* import { Suspense } from 'react'
|
|
23
|
+
* import { QueriesHydration } from '@suspensive/react-query'
|
|
24
|
+
* import { queryOptions } from '@tanstack/react-query'
|
|
25
|
+
*
|
|
26
|
+
* const userQueryOptions = (userId: string) => queryOptions({
|
|
27
|
+
* queryKey: ['user', userId],
|
|
28
|
+
* queryFn: () => fetchUser(userId)
|
|
29
|
+
* })
|
|
30
|
+
*
|
|
31
|
+
* const postsQueryOptions = () => queryOptions({
|
|
32
|
+
* queryKey: ['posts'],
|
|
33
|
+
* queryFn: () => fetchPosts()
|
|
34
|
+
* })
|
|
35
|
+
*
|
|
36
|
+
* export default function Page({ userId }: { userId: string }) {
|
|
37
|
+
* return (
|
|
38
|
+
* <>
|
|
39
|
+
* <Suspense fallback={<div>Loading user...</div>}>
|
|
40
|
+
* <QueriesHydration queries={[userQueryOptions(userId)]}>
|
|
41
|
+
* <UserProfile />
|
|
42
|
+
* </QueriesHydration>
|
|
43
|
+
* </Suspense>
|
|
44
|
+
*
|
|
45
|
+
* <Suspense fallback={<div>Loading posts...</div>}>
|
|
46
|
+
* <QueriesHydration queries={[postsQueryOptions()]}>
|
|
47
|
+
* <PostsList />
|
|
48
|
+
* </QueriesHydration>
|
|
49
|
+
* </Suspense>
|
|
50
|
+
* </>
|
|
51
|
+
* )
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* // With custom error fallback
|
|
58
|
+
* <Suspense fallback={<div>Loading user...</div>}>
|
|
59
|
+
* <QueriesHydration
|
|
60
|
+
* queries={[userQueryOptions(userId)]}
|
|
61
|
+
* skipSsrOnError={{ fallback: <div>Fetching on client...</div> }}
|
|
62
|
+
* >
|
|
63
|
+
* <UserProfile />
|
|
64
|
+
* </QueriesHydration>
|
|
65
|
+
* </Suspense>
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @see {@link https://suspensive.org/docs/react-query/QueriesHydration Documentation}
|
|
69
|
+
*/
|
|
70
|
+
declare function QueriesHydration({
|
|
71
|
+
queries,
|
|
72
|
+
children,
|
|
73
|
+
queryClient,
|
|
74
|
+
skipSsrOnError,
|
|
75
|
+
timeout,
|
|
76
|
+
...props
|
|
77
|
+
}: {
|
|
78
|
+
/**
|
|
79
|
+
* The QueryClient instance to use for fetching queries.
|
|
80
|
+
*/
|
|
81
|
+
queryClient?: QueryClient;
|
|
82
|
+
/**
|
|
83
|
+
* An array of query options or infinite query options to be fetched on the server. Each query must include a `queryKey`.
|
|
84
|
+
* You can mix regular queries and infinite queries in the same array.
|
|
85
|
+
*/
|
|
86
|
+
queries: (WithRequired<QueryOptions<any, any, any, any>, 'queryKey'> | WithRequired<UseInfiniteQueryOptions<any, any, any, any, any>, 'queryKey'>)[];
|
|
87
|
+
/**
|
|
88
|
+
* Controls error handling behavior:
|
|
89
|
+
* - `true` (default): Skips SSR and falls back to client-side rendering when server fetch fails
|
|
90
|
+
* - `false`: Proceeds with SSR without hydration (retry fetching on client component server rendering)
|
|
91
|
+
* - `{ fallback: ReactNode }`: Skips SSR with custom fallback UI during client-side rendering
|
|
92
|
+
*/
|
|
93
|
+
skipSsrOnError?: boolean | {
|
|
94
|
+
fallback: ReactNode;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* The timeout in milliseconds for the query.
|
|
98
|
+
* If the query takes longer than the timeout, it will be considered as an error.
|
|
99
|
+
* When not set, no timeout is applied.
|
|
100
|
+
*/
|
|
101
|
+
timeout?: number;
|
|
102
|
+
} & OmitKeyof<HydrateProps, 'state'>): Promise<react_jsx_runtime0.JSX.Element>;
|
|
103
|
+
//#endregion
|
|
104
|
+
export { QueriesHydration };
|
|
105
|
+
//# sourceMappingURL=QueriesHydration.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,5 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
let _tanstack_react_query = require("@tanstack/react-query");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
//#region src/QueryClientConsumer.tsx
|
|
8
|
+
/**
|
|
9
|
+
* @experimental This is experimental feature.
|
|
10
|
+
*/
|
|
11
|
+
function QueryClientConsumer({ children, context }) {
|
|
12
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: children((0, _tanstack_react_query.useQueryClient)({ context })) });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.QueryClientConsumer = QueryClientConsumer;
|
|
17
|
+
//# sourceMappingURL=QueryClientConsumer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryClientConsumer.cjs","names":[],"sources":["../src/QueryClientConsumer.tsx"],"sourcesContent":["'use client'\n\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":";;;;;;;;;;AAQA,SAAgB,oBAAoB,EAClC,UACA,WAIC;AACD,QAAO,mFAAG,mDAAwB,EAAW,SAAgB,CAAC,CAAC,EAAI"}
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import { QueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { Context, ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/QueryClientConsumer.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* @experimental This is experimental feature.
|
|
8
|
+
*/
|
|
9
|
+
declare function QueryClientConsumer({
|
|
10
|
+
children,
|
|
11
|
+
context
|
|
12
|
+
}: {
|
|
13
|
+
children: (queryClient: QueryClient) => ReactNode;
|
|
14
|
+
context?: Context<QueryClient | undefined>;
|
|
15
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { QueryClientConsumer };
|
|
18
|
+
//# sourceMappingURL=QueryClientConsumer.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryClientConsumer.d.cts","names":[],"sources":["../src/QueryClientConsumer.tsx"],"mappings":";;;;;;;;iBAQgB,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,2 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { QueryClient } from "@tanstack/react-query";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { Context, ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/QueryClientConsumer.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* @experimental This is experimental feature.
|
|
8
|
+
*/
|
|
9
|
+
declare function QueryClientConsumer({
|
|
10
|
+
children,
|
|
11
|
+
context
|
|
12
|
+
}: {
|
|
13
|
+
children: (queryClient: QueryClient) => ReactNode;
|
|
14
|
+
context?: Context<QueryClient | undefined>;
|
|
15
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { QueryClientConsumer };
|
|
18
|
+
//# sourceMappingURL=QueryClientConsumer.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryClientConsumer.d.mts","names":[],"sources":["../src/QueryClientConsumer.tsx"],"mappings":";;;;;;;;iBAQgB,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,5 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
//#region src/QueryClientConsumer.tsx
|
|
7
|
+
/**
|
|
8
|
+
* @experimental This is experimental feature.
|
|
9
|
+
*/
|
|
10
|
+
function QueryClientConsumer({ children, context }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(useQueryClient({ context })) });
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { QueryClientConsumer };
|
|
16
|
+
//# sourceMappingURL=QueryClientConsumer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryClientConsumer.mjs","names":[],"sources":["../src/QueryClientConsumer.tsx"],"sourcesContent":["'use client'\n\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":";;;;;;;;;AAQA,SAAgB,oBAAoB,EAClC,UACA,WAIC;AACD,QAAO,0CAAG,SAAS,eAAe,EAAW,SAAgB,CAAC,CAAC,EAAI"}
|
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_objectWithoutProperties = require('./objectWithoutProperties-CfjOeCpP.cjs');
|
|
5
|
+
let _tanstack_react_query = require("@tanstack/react-query");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
//#region src/SuspenseInfiniteQuery.tsx
|
|
9
|
+
const _excluded = ["children"];
|
|
10
|
+
/**
|
|
11
|
+
* We provide these components to clearly express what causes suspense at the same depth.
|
|
12
|
+
* `<SuspenseInfiniteQuery/>` serves to make `useSuspenseInfiniteQuery` easier to use in jsx.
|
|
13
|
+
* @see {@link https://suspensive.org/docs/react-query/SuspenseInfiniteQuery Suspensive Docs}
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import { SuspenseInfiniteQuery } from '@suspensive/react-query'
|
|
17
|
+
*
|
|
18
|
+
* // You can use infiniteQueryOptions as props.
|
|
19
|
+
* <SuspenseInfiniteQuery {...infiniteQueryOptions()}>
|
|
20
|
+
* {({ data, fetchNextPage }) => {
|
|
21
|
+
* return <></>
|
|
22
|
+
* }}
|
|
23
|
+
* </SuspenseInfiniteQuery>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
const SuspenseInfiniteQuery = (_ref) => {
|
|
27
|
+
let { children } = _ref;
|
|
28
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: children((0, _tanstack_react_query.useSuspenseInfiniteQuery)(require_objectWithoutProperties._objectWithoutProperties(_ref, _excluded))) });
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.SuspenseInfiniteQuery = SuspenseInfiniteQuery;
|
|
33
|
+
//# sourceMappingURL=SuspenseInfiniteQuery.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuspenseInfiniteQuery.cjs","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,2FAAG,uIAA0C,CAAC,EAAI"}
|
|
@@ -1,2 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { UseSuspenseInfiniteQueryOptions } from "./useSuspenseInfiniteQuery.cjs";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { QueryKey, UseSuspenseInfiniteQueryResult } from "@tanstack/react-query";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/SuspenseInfiniteQuery.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* We provide these components to clearly express what causes suspense at the same depth.
|
|
9
|
+
* `<SuspenseInfiniteQuery/>` serves to make `useSuspenseInfiniteQuery` easier to use in jsx.
|
|
10
|
+
* @see {@link https://suspensive.org/docs/react-query/SuspenseInfiniteQuery Suspensive Docs}
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { SuspenseInfiniteQuery } from '@suspensive/react-query'
|
|
14
|
+
*
|
|
15
|
+
* // You can use infiniteQueryOptions as props.
|
|
16
|
+
* <SuspenseInfiniteQuery {...infiniteQueryOptions()}>
|
|
17
|
+
* {({ data, fetchNextPage }) => {
|
|
18
|
+
* return <></>
|
|
19
|
+
* }}
|
|
20
|
+
* </SuspenseInfiniteQuery>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare const SuspenseInfiniteQuery: <TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>({
|
|
24
|
+
children,
|
|
25
|
+
...options
|
|
26
|
+
}: UseSuspenseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
27
|
+
children: (query: UseSuspenseInfiniteQueryResult<TData, TError>) => ReactNode;
|
|
28
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { SuspenseInfiniteQuery };
|
|
31
|
+
//# sourceMappingURL=SuspenseInfiniteQuery.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuspenseInfiniteQuery.d.cts","names":[],"sources":["../src/SuspenseInfiniteQuery.tsx"],"mappings":";;;;;;;;;AAqBA;;;;;;;;;;;;;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,3 +1,31 @@
|
|
|
1
|
-
import "./useSuspenseInfiniteQuery
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { UseSuspenseInfiniteQueryOptions } from "./useSuspenseInfiniteQuery.mjs";
|
|
2
|
+
import { QueryKey, UseSuspenseInfiniteQueryResult } from "@tanstack/react-query";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/SuspenseInfiniteQuery.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* We provide these components to clearly express what causes suspense at the same depth.
|
|
9
|
+
* `<SuspenseInfiniteQuery/>` serves to make `useSuspenseInfiniteQuery` easier to use in jsx.
|
|
10
|
+
* @see {@link https://suspensive.org/docs/react-query/SuspenseInfiniteQuery Suspensive Docs}
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { SuspenseInfiniteQuery } from '@suspensive/react-query'
|
|
14
|
+
*
|
|
15
|
+
* // You can use infiniteQueryOptions as props.
|
|
16
|
+
* <SuspenseInfiniteQuery {...infiniteQueryOptions()}>
|
|
17
|
+
* {({ data, fetchNextPage }) => {
|
|
18
|
+
* return <></>
|
|
19
|
+
* }}
|
|
20
|
+
* </SuspenseInfiniteQuery>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare const SuspenseInfiniteQuery: <TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>({
|
|
24
|
+
children,
|
|
25
|
+
...options
|
|
26
|
+
}: UseSuspenseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
|
|
27
|
+
children: (query: UseSuspenseInfiniteQueryResult<TData, TError>) => ReactNode;
|
|
28
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { SuspenseInfiniteQuery };
|
|
31
|
+
//# sourceMappingURL=SuspenseInfiniteQuery.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuspenseInfiniteQuery.d.mts","names":[],"sources":["../src/SuspenseInfiniteQuery.tsx"],"mappings":";;;;;;;;;AAqBA;;;;;;;;;;;;;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,5 +1,32 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { t as
|
|
3
|
+
import { t as _objectWithoutProperties } from "./objectWithoutProperties-CZk5Qmfh.mjs";
|
|
4
|
+
import { useSuspenseInfiniteQuery } from "@tanstack/react-query";
|
|
5
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
//#region src/SuspenseInfiniteQuery.tsx
|
|
8
|
+
const _excluded = ["children"];
|
|
9
|
+
/**
|
|
10
|
+
* We provide these components to clearly express what causes suspense at the same depth.
|
|
11
|
+
* `<SuspenseInfiniteQuery/>` serves to make `useSuspenseInfiniteQuery` easier to use in jsx.
|
|
12
|
+
* @see {@link https://suspensive.org/docs/react-query/SuspenseInfiniteQuery Suspensive Docs}
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { SuspenseInfiniteQuery } from '@suspensive/react-query'
|
|
16
|
+
*
|
|
17
|
+
* // You can use infiniteQueryOptions as props.
|
|
18
|
+
* <SuspenseInfiniteQuery {...infiniteQueryOptions()}>
|
|
19
|
+
* {({ data, fetchNextPage }) => {
|
|
20
|
+
* return <></>
|
|
21
|
+
* }}
|
|
22
|
+
* </SuspenseInfiniteQuery>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
const SuspenseInfiniteQuery = (_ref) => {
|
|
26
|
+
let { children } = _ref;
|
|
27
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(useSuspenseInfiniteQuery(_objectWithoutProperties(_ref, _excluded))) });
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { SuspenseInfiniteQuery };
|
|
32
|
+
//# sourceMappingURL=SuspenseInfiniteQuery.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuspenseInfiniteQuery.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,EAAI"}
|
package/dist/SuspenseQueries.cjs
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
let _tanstack_react_query = require("@tanstack/react-query");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
//#region src/SuspenseQueries.tsx
|
|
8
|
+
/**
|
|
9
|
+
* We provide these components to clearly express what causes suspense at the same depth.
|
|
10
|
+
* `<SuspenseQueries/>` serves to make `useSuspenseQueries` easier to use in jsx.
|
|
11
|
+
* @see {@link https://suspensive.org/docs/react-query/SuspenseQueries Suspensive Docs}
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* import { SuspenseQueries } from '@suspensive/react-query'
|
|
15
|
+
*
|
|
16
|
+
* <SuspenseQueries queries={[firstQueryOptions(), secondQueryOptions()]}>
|
|
17
|
+
* {([{ data: firstQueryData }, { data: secondQueryData }]) => {
|
|
18
|
+
* return <></>
|
|
19
|
+
* }}
|
|
20
|
+
* </SuspenseQueries>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
function SuspenseQueries({ children, queries }) {
|
|
24
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: children((0, _tanstack_react_query.useSuspenseQueries)({ queries })) });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.SuspenseQueries = SuspenseQueries;
|
|
29
|
+
//# sourceMappingURL=SuspenseQueries.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuspenseQueries.cjs","names":[],"sources":["../src/SuspenseQueries.tsx"],"sourcesContent":["'use client'\n\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":";;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,gBAAiC,EAC/C,UACA,WAIC;AACD,QAAO,mFAAG,uDAA4B,EAAE,SAAS,CAAC,CAAC,EAAI"}
|
|
@@ -1,2 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import { SuspenseQueriesOptions, SuspenseQueriesResults } from "@tanstack/react-query";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/SuspenseQueries.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* We provide these components to clearly express what causes suspense at the same depth.
|
|
8
|
+
* `<SuspenseQueries/>` serves to make `useSuspenseQueries` easier to use in jsx.
|
|
9
|
+
* @see {@link https://suspensive.org/docs/react-query/SuspenseQueries Suspensive Docs}
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { SuspenseQueries } from '@suspensive/react-query'
|
|
13
|
+
*
|
|
14
|
+
* <SuspenseQueries queries={[firstQueryOptions(), secondQueryOptions()]}>
|
|
15
|
+
* {([{ data: firstQueryData }, { data: secondQueryData }]) => {
|
|
16
|
+
* return <></>
|
|
17
|
+
* }}
|
|
18
|
+
* </SuspenseQueries>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare function SuspenseQueries<T extends any[]>({
|
|
22
|
+
children,
|
|
23
|
+
queries
|
|
24
|
+
}: {
|
|
25
|
+
queries: readonly [...SuspenseQueriesOptions<T>];
|
|
26
|
+
children: (queries: SuspenseQueriesResults<T>) => ReactNode;
|
|
27
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { SuspenseQueries };
|
|
30
|
+
//# sourceMappingURL=SuspenseQueries.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuspenseQueries.d.cts","names":[],"sources":["../src/SuspenseQueries.tsx"],"mappings":";;;;;;;;AAoBA;;;;;;;;;;;;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,2 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SuspenseQueriesOptions, SuspenseQueriesResults } from "@tanstack/react-query";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/SuspenseQueries.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* We provide these components to clearly express what causes suspense at the same depth.
|
|
8
|
+
* `<SuspenseQueries/>` serves to make `useSuspenseQueries` easier to use in jsx.
|
|
9
|
+
* @see {@link https://suspensive.org/docs/react-query/SuspenseQueries Suspensive Docs}
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { SuspenseQueries } from '@suspensive/react-query'
|
|
13
|
+
*
|
|
14
|
+
* <SuspenseQueries queries={[firstQueryOptions(), secondQueryOptions()]}>
|
|
15
|
+
* {([{ data: firstQueryData }, { data: secondQueryData }]) => {
|
|
16
|
+
* return <></>
|
|
17
|
+
* }}
|
|
18
|
+
* </SuspenseQueries>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare function SuspenseQueries<T extends any[]>({
|
|
22
|
+
children,
|
|
23
|
+
queries
|
|
24
|
+
}: {
|
|
25
|
+
queries: readonly [...SuspenseQueriesOptions<T>];
|
|
26
|
+
children: (queries: SuspenseQueriesResults<T>) => ReactNode;
|
|
27
|
+
}): react_jsx_runtime0.JSX.Element;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { SuspenseQueries };
|
|
30
|
+
//# sourceMappingURL=SuspenseQueries.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuspenseQueries.d.mts","names":[],"sources":["../src/SuspenseQueries.tsx"],"mappings":";;;;;;;;AAoBA;;;;;;;;;;;;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"}
|
package/dist/SuspenseQueries.mjs
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { useSuspenseQueries } from "@tanstack/react-query";
|
|
4
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
//#region src/SuspenseQueries.tsx
|
|
7
|
+
/**
|
|
8
|
+
* We provide these components to clearly express what causes suspense at the same depth.
|
|
9
|
+
* `<SuspenseQueries/>` serves to make `useSuspenseQueries` easier to use in jsx.
|
|
10
|
+
* @see {@link https://suspensive.org/docs/react-query/SuspenseQueries Suspensive Docs}
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { SuspenseQueries } from '@suspensive/react-query'
|
|
14
|
+
*
|
|
15
|
+
* <SuspenseQueries queries={[firstQueryOptions(), secondQueryOptions()]}>
|
|
16
|
+
* {([{ data: firstQueryData }, { data: secondQueryData }]) => {
|
|
17
|
+
* return <></>
|
|
18
|
+
* }}
|
|
19
|
+
* </SuspenseQueries>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
function SuspenseQueries({ children, queries }) {
|
|
23
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children(useSuspenseQueries({ queries })) });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { SuspenseQueries };
|
|
28
|
+
//# sourceMappingURL=SuspenseQueries.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuspenseQueries.mjs","names":[],"sources":["../src/SuspenseQueries.tsx"],"sourcesContent":["'use client'\n\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":";;;;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,gBAAiC,EAC/C,UACA,WAIC;AACD,QAAO,0CAAG,SAAS,mBAAmB,EAAE,SAAS,CAAC,CAAC,EAAI"}
|