@suspensive/react-query-4 3.19.2 → 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.
Files changed (310) hide show
  1. package/dist/IsFetching.cjs +18 -2
  2. package/dist/IsFetching.cjs.map +1 -0
  3. package/dist/IsFetching.d.cts +18 -2
  4. package/dist/IsFetching.d.cts.map +1 -0
  5. package/dist/IsFetching.d.mts +18 -2
  6. package/dist/IsFetching.d.mts.map +1 -0
  7. package/dist/IsFetching.mjs +17 -2
  8. package/dist/IsFetching.mjs.map +1 -0
  9. package/dist/Mutation.cjs +14 -2
  10. package/dist/Mutation.cjs.map +1 -0
  11. package/dist/Mutation.d.cts +14 -2
  12. package/dist/Mutation.d.cts.map +1 -0
  13. package/dist/Mutation.d.mts +14 -2
  14. package/dist/Mutation.d.mts.map +1 -0
  15. package/dist/Mutation.mjs +13 -2
  16. package/dist/Mutation.mjs.map +1 -0
  17. package/dist/PrefetchInfiniteQuery.cjs +20 -2
  18. package/dist/PrefetchInfiniteQuery.cjs.map +1 -0
  19. package/dist/PrefetchInfiniteQuery.d.cts +16 -2
  20. package/dist/PrefetchInfiniteQuery.d.cts.map +1 -0
  21. package/dist/PrefetchInfiniteQuery.d.mts +16 -2
  22. package/dist/PrefetchInfiniteQuery.d.mts.map +1 -0
  23. package/dist/PrefetchInfiniteQuery.mjs +19 -2
  24. package/dist/PrefetchInfiniteQuery.mjs.map +1 -0
  25. package/dist/PrefetchQuery.cjs +20 -2
  26. package/dist/PrefetchQuery.cjs.map +1 -0
  27. package/dist/PrefetchQuery.d.cts +16 -2
  28. package/dist/PrefetchQuery.d.cts.map +1 -0
  29. package/dist/PrefetchQuery.d.mts +16 -2
  30. package/dist/PrefetchQuery.d.mts.map +1 -0
  31. package/dist/PrefetchQuery.mjs +19 -2
  32. package/dist/PrefetchQuery.mjs.map +1 -0
  33. package/dist/{QueriesHydration-dcSAzQNT.cjs → QueriesHydration-B9tinfWA.cjs} +16 -16
  34. package/dist/QueriesHydration-B9tinfWA.cjs.map +1 -0
  35. package/dist/{QueriesHydration-GQxJe_Vu.mjs → QueriesHydration-MZQ7Oj60.mjs} +11 -11
  36. package/dist/QueriesHydration-MZQ7Oj60.mjs.map +1 -0
  37. package/dist/QueriesHydration.cjs +2 -1
  38. package/dist/QueriesHydration.d.cts +105 -2
  39. package/dist/QueriesHydration.d.cts.map +1 -0
  40. package/dist/QueriesHydration.d.mts +105 -2
  41. package/dist/QueriesHydration.d.mts.map +1 -0
  42. package/dist/QueriesHydration.mjs +1 -1
  43. package/dist/QueryClientConsumer.cjs +14 -2
  44. package/dist/QueryClientConsumer.cjs.map +1 -0
  45. package/dist/QueryClientConsumer.d.cts +18 -2
  46. package/dist/QueryClientConsumer.d.cts.map +1 -0
  47. package/dist/QueryClientConsumer.d.mts +18 -2
  48. package/dist/QueryClientConsumer.d.mts.map +1 -0
  49. package/dist/QueryClientConsumer.mjs +13 -2
  50. package/dist/QueryClientConsumer.mjs.map +1 -0
  51. package/dist/SuspenseInfiniteQuery.cjs +30 -2
  52. package/dist/SuspenseInfiniteQuery.cjs.map +1 -0
  53. package/dist/SuspenseInfiniteQuery.d.cts +31 -2
  54. package/dist/SuspenseInfiniteQuery.d.cts.map +1 -0
  55. package/dist/SuspenseInfiniteQuery.d.mts +31 -3
  56. package/dist/SuspenseInfiniteQuery.d.mts.map +1 -0
  57. package/dist/SuspenseInfiniteQuery.mjs +29 -2
  58. package/dist/SuspenseInfiniteQuery.mjs.map +1 -0
  59. package/dist/SuspenseQueries.cjs +26 -2
  60. package/dist/SuspenseQueries.cjs.map +1 -0
  61. package/dist/SuspenseQueries.d.cts +30 -2
  62. package/dist/SuspenseQueries.d.cts.map +1 -0
  63. package/dist/SuspenseQueries.d.mts +30 -2
  64. package/dist/SuspenseQueries.d.mts.map +1 -0
  65. package/dist/SuspenseQueries.mjs +25 -2
  66. package/dist/SuspenseQueries.mjs.map +1 -0
  67. package/dist/SuspenseQuery.cjs +30 -2
  68. package/dist/SuspenseQuery.cjs.map +1 -0
  69. package/dist/SuspenseQuery.d.cts +30 -2
  70. package/dist/SuspenseQuery.d.cts.map +1 -0
  71. package/dist/SuspenseQuery.d.mts +30 -2
  72. package/dist/SuspenseQuery.d.mts.map +1 -0
  73. package/dist/SuspenseQuery.mjs +29 -2
  74. package/dist/SuspenseQuery.mjs.map +1 -0
  75. package/dist/components/ClientOnly.cjs +13 -2
  76. package/dist/components/ClientOnly.cjs.map +1 -0
  77. package/dist/components/ClientOnly.d.cts +2 -2
  78. package/dist/components/ClientOnly.d.cts.map +1 -1
  79. package/dist/components/ClientOnly.d.mts +2 -2
  80. package/dist/components/ClientOnly.d.mts.map +1 -1
  81. package/dist/components/ClientOnly.mjs +12 -2
  82. package/dist/components/ClientOnly.mjs.map +1 -0
  83. package/dist/createGetQueryClient.cjs +63 -2
  84. package/dist/createGetQueryClient.cjs.map +1 -0
  85. package/dist/createGetQueryClient.d.cts +53 -2
  86. package/dist/createGetQueryClient.d.cts.map +1 -0
  87. package/dist/createGetQueryClient.d.mts +53 -2
  88. package/dist/createGetQueryClient.d.mts.map +1 -0
  89. package/dist/createGetQueryClient.mjs +62 -2
  90. package/dist/createGetQueryClient.mjs.map +1 -0
  91. package/dist/index.cjs +19 -18
  92. package/dist/index.d.cts +18 -18
  93. package/dist/index.d.mts +18 -18
  94. package/dist/index.mjs +18 -18
  95. package/dist/infiniteQueryOptions.cjs +17 -2
  96. package/dist/infiniteQueryOptions.cjs.map +1 -0
  97. package/dist/infiniteQueryOptions.d.cts +28 -2
  98. package/dist/infiniteQueryOptions.d.cts.map +1 -0
  99. package/dist/infiniteQueryOptions.d.mts +28 -2
  100. package/dist/infiniteQueryOptions.d.mts.map +1 -0
  101. package/dist/infiniteQueryOptions.mjs +16 -2
  102. package/dist/infiniteQueryOptions.mjs.map +1 -0
  103. package/dist/mutationOptions.cjs +9 -2
  104. package/dist/mutationOptions.cjs.map +1 -0
  105. package/dist/mutationOptions.d.cts +7 -2
  106. package/dist/mutationOptions.d.cts.map +1 -0
  107. package/dist/mutationOptions.d.mts +7 -2
  108. package/dist/mutationOptions.d.mts.map +1 -0
  109. package/dist/mutationOptions.mjs +7 -2
  110. package/dist/mutationOptions.mjs.map +1 -0
  111. package/dist/{objectSpread2-CpqxxdM2.cjs → objectSpread2-9HkiXZY2.cjs} +15 -15
  112. package/dist/{objectSpread2-BFPIJj0i.mjs → objectSpread2-BX3M3dlG.mjs} +15 -15
  113. package/dist/{objectWithoutProperties-BYP50gyF.mjs → objectWithoutProperties-CZk5Qmfh.mjs} +2 -2
  114. package/dist/{objectWithoutProperties-CYXRK7DS.cjs → objectWithoutProperties-CfjOeCpP.cjs} +2 -2
  115. package/dist/queryOptions.cjs +17 -2
  116. package/dist/queryOptions.cjs.map +1 -0
  117. package/dist/queryOptions.d.cts +28 -2
  118. package/dist/queryOptions.d.cts.map +1 -0
  119. package/dist/queryOptions.d.mts +28 -2
  120. package/dist/queryOptions.d.mts.map +1 -0
  121. package/dist/queryOptions.mjs +16 -2
  122. package/dist/queryOptions.mjs.map +1 -0
  123. package/dist/usePrefetchInfiniteQuery.cjs +15 -2
  124. package/dist/usePrefetchInfiniteQuery.cjs.map +1 -0
  125. package/dist/usePrefetchInfiniteQuery.d.cts +11 -2
  126. package/dist/usePrefetchInfiniteQuery.d.cts.map +1 -0
  127. package/dist/usePrefetchInfiniteQuery.d.mts +11 -2
  128. package/dist/usePrefetchInfiniteQuery.d.mts.map +1 -0
  129. package/dist/usePrefetchInfiniteQuery.mjs +14 -2
  130. package/dist/usePrefetchInfiniteQuery.mjs.map +1 -0
  131. package/dist/usePrefetchQuery.cjs +15 -2
  132. package/dist/usePrefetchQuery.cjs.map +1 -0
  133. package/dist/usePrefetchQuery.d.cts +11 -2
  134. package/dist/usePrefetchQuery.d.cts.map +1 -0
  135. package/dist/usePrefetchQuery.d.mts +11 -2
  136. package/dist/usePrefetchQuery.d.mts.map +1 -0
  137. package/dist/usePrefetchQuery.mjs +14 -2
  138. package/dist/usePrefetchQuery.mjs.map +1 -0
  139. package/dist/useSuspenseInfiniteQuery.cjs +17 -2
  140. package/dist/useSuspenseInfiniteQuery.cjs.map +1 -0
  141. package/dist/useSuspenseInfiniteQuery.d.cts +17 -2
  142. package/dist/useSuspenseInfiniteQuery.d.cts.map +1 -0
  143. package/dist/useSuspenseInfiniteQuery.d.mts +17 -2
  144. package/dist/useSuspenseInfiniteQuery.d.mts.map +1 -0
  145. package/dist/useSuspenseInfiniteQuery.mjs +16 -2
  146. package/dist/useSuspenseInfiniteQuery.mjs.map +1 -0
  147. package/dist/useSuspenseQueries.cjs +17 -2
  148. package/dist/useSuspenseQueries.cjs.map +1 -0
  149. package/dist/useSuspenseQueries.d.cts +36 -2
  150. package/dist/useSuspenseQueries.d.cts.map +1 -0
  151. package/dist/useSuspenseQueries.d.mts +36 -2
  152. package/dist/useSuspenseQueries.d.mts.map +1 -0
  153. package/dist/useSuspenseQueries.mjs +16 -2
  154. package/dist/useSuspenseQueries.mjs.map +1 -0
  155. package/dist/useSuspenseQuery.cjs +17 -2
  156. package/dist/useSuspenseQuery.cjs.map +1 -0
  157. package/dist/useSuspenseQuery.d.cts +36 -2
  158. package/dist/useSuspenseQuery.d.cts.map +1 -0
  159. package/dist/useSuspenseQuery.d.mts +36 -2
  160. package/dist/useSuspenseQuery.d.mts.map +1 -0
  161. package/dist/useSuspenseQuery.mjs +16 -2
  162. package/dist/useSuspenseQuery.mjs.map +1 -0
  163. package/package.json +4 -4
  164. package/src/createGetQueryClient.spec.tsx +25 -77
  165. package/dist/ClientOnly-BdmzVYnI.mjs +0 -15
  166. package/dist/ClientOnly-BdmzVYnI.mjs.map +0 -1
  167. package/dist/ClientOnly-Dvf8t__-.cjs +0 -20
  168. package/dist/ClientOnly-Dvf8t__-.cjs.map +0 -1
  169. package/dist/IsFetching-BYkNw1cs.mjs +0 -18
  170. package/dist/IsFetching-BYkNw1cs.mjs.map +0 -1
  171. package/dist/IsFetching-BfIQ3Qek.d.mts +0 -19
  172. package/dist/IsFetching-BfIQ3Qek.d.mts.map +0 -1
  173. package/dist/IsFetching-BhOgGqrs.cjs +0 -23
  174. package/dist/IsFetching-BhOgGqrs.cjs.map +0 -1
  175. package/dist/IsFetching-CuftXnaJ.d.cts +0 -19
  176. package/dist/IsFetching-CuftXnaJ.d.cts.map +0 -1
  177. package/dist/Mutation-CGUYEkKX.cjs +0 -19
  178. package/dist/Mutation-CGUYEkKX.cjs.map +0 -1
  179. package/dist/Mutation-CGpbCg54.d.mts +0 -14
  180. package/dist/Mutation-CGpbCg54.d.mts.map +0 -1
  181. package/dist/Mutation-DGmP7HQI.d.cts +0 -14
  182. package/dist/Mutation-DGmP7HQI.d.cts.map +0 -1
  183. package/dist/Mutation-DUJhz3rT.mjs +0 -14
  184. package/dist/Mutation-DUJhz3rT.mjs.map +0 -1
  185. package/dist/PrefetchInfiniteQuery-BewcG5rR.d.cts +0 -17
  186. package/dist/PrefetchInfiniteQuery-BewcG5rR.d.cts.map +0 -1
  187. package/dist/PrefetchInfiniteQuery-D-3dZMEz.d.mts +0 -17
  188. package/dist/PrefetchInfiniteQuery-D-3dZMEz.d.mts.map +0 -1
  189. package/dist/PrefetchInfiniteQuery-RS3Qz-7B.mjs +0 -20
  190. package/dist/PrefetchInfiniteQuery-RS3Qz-7B.mjs.map +0 -1
  191. package/dist/PrefetchInfiniteQuery-cCSXqKVR.cjs +0 -25
  192. package/dist/PrefetchInfiniteQuery-cCSXqKVR.cjs.map +0 -1
  193. package/dist/PrefetchQuery-0pdYNtpS.cjs +0 -25
  194. package/dist/PrefetchQuery-0pdYNtpS.cjs.map +0 -1
  195. package/dist/PrefetchQuery-Ddbt43Fk.d.cts +0 -17
  196. package/dist/PrefetchQuery-Ddbt43Fk.d.cts.map +0 -1
  197. package/dist/PrefetchQuery-DqgbVdjY.d.mts +0 -17
  198. package/dist/PrefetchQuery-DqgbVdjY.d.mts.map +0 -1
  199. package/dist/PrefetchQuery-uh4idoXK.mjs +0 -20
  200. package/dist/PrefetchQuery-uh4idoXK.mjs.map +0 -1
  201. package/dist/QueriesHydration-DPogKsc4.d.mts +0 -106
  202. package/dist/QueriesHydration-DPogKsc4.d.mts.map +0 -1
  203. package/dist/QueriesHydration-DnlRrHJ3.d.cts +0 -106
  204. package/dist/QueriesHydration-DnlRrHJ3.d.cts.map +0 -1
  205. package/dist/QueriesHydration-GQxJe_Vu.mjs.map +0 -1
  206. package/dist/QueriesHydration-dcSAzQNT.cjs.map +0 -1
  207. package/dist/QueryClientConsumer-5PZLv_8g.d.mts +0 -18
  208. package/dist/QueryClientConsumer-5PZLv_8g.d.mts.map +0 -1
  209. package/dist/QueryClientConsumer-e7PyaFF3.mjs +0 -14
  210. package/dist/QueryClientConsumer-e7PyaFF3.mjs.map +0 -1
  211. package/dist/QueryClientConsumer-mF0OUwkq.cjs +0 -19
  212. package/dist/QueryClientConsumer-mF0OUwkq.cjs.map +0 -1
  213. package/dist/QueryClientConsumer-pihgMOoA.d.cts +0 -18
  214. package/dist/QueryClientConsumer-pihgMOoA.d.cts.map +0 -1
  215. package/dist/SuspenseInfiniteQuery-BimBkaCe.mjs +0 -30
  216. package/dist/SuspenseInfiniteQuery-BimBkaCe.mjs.map +0 -1
  217. package/dist/SuspenseInfiniteQuery-BtRviR-Z.d.mts +0 -32
  218. package/dist/SuspenseInfiniteQuery-BtRviR-Z.d.mts.map +0 -1
  219. package/dist/SuspenseInfiniteQuery-DSYC5XON.d.cts +0 -32
  220. package/dist/SuspenseInfiniteQuery-DSYC5XON.d.cts.map +0 -1
  221. package/dist/SuspenseInfiniteQuery-oVQE2P2T.cjs +0 -35
  222. package/dist/SuspenseInfiniteQuery-oVQE2P2T.cjs.map +0 -1
  223. package/dist/SuspenseQueries-BPvriygJ.d.cts +0 -31
  224. package/dist/SuspenseQueries-BPvriygJ.d.cts.map +0 -1
  225. package/dist/SuspenseQueries-Brk6gtMw.cjs +0 -31
  226. package/dist/SuspenseQueries-Brk6gtMw.cjs.map +0 -1
  227. package/dist/SuspenseQueries-C0mF_XD_.mjs +0 -26
  228. package/dist/SuspenseQueries-C0mF_XD_.mjs.map +0 -1
  229. package/dist/SuspenseQueries-CHFS9e4y.d.mts +0 -31
  230. package/dist/SuspenseQueries-CHFS9e4y.d.mts.map +0 -1
  231. package/dist/SuspenseQuery-BWI24top.mjs +0 -30
  232. package/dist/SuspenseQuery-BWI24top.mjs.map +0 -1
  233. package/dist/SuspenseQuery-D4IZU_Co.d.cts +0 -31
  234. package/dist/SuspenseQuery-D4IZU_Co.d.cts.map +0 -1
  235. package/dist/SuspenseQuery-DE4NKrqP.cjs +0 -35
  236. package/dist/SuspenseQuery-DE4NKrqP.cjs.map +0 -1
  237. package/dist/SuspenseQuery-VjYG_b1z.d.mts +0 -31
  238. package/dist/SuspenseQuery-VjYG_b1z.d.mts.map +0 -1
  239. package/dist/createGetQueryClient-B0yrcyXF.mjs +0 -63
  240. package/dist/createGetQueryClient-B0yrcyXF.mjs.map +0 -1
  241. package/dist/createGetQueryClient-DTKVVwpJ.d.mts +0 -54
  242. package/dist/createGetQueryClient-DTKVVwpJ.d.mts.map +0 -1
  243. package/dist/createGetQueryClient-iXoXO7so.d.cts +0 -54
  244. package/dist/createGetQueryClient-iXoXO7so.d.cts.map +0 -1
  245. package/dist/createGetQueryClient-nXvPqrrS.cjs +0 -68
  246. package/dist/createGetQueryClient-nXvPqrrS.cjs.map +0 -1
  247. package/dist/infiniteQueryOptions-2KFmTqEY.mjs +0 -17
  248. package/dist/infiniteQueryOptions-2KFmTqEY.mjs.map +0 -1
  249. package/dist/infiniteQueryOptions-BVac5B-c.cjs +0 -22
  250. package/dist/infiniteQueryOptions-BVac5B-c.cjs.map +0 -1
  251. package/dist/infiniteQueryOptions-Be7VYTUR.d.cts +0 -29
  252. package/dist/infiniteQueryOptions-Be7VYTUR.d.cts.map +0 -1
  253. package/dist/infiniteQueryOptions-Bpz4mFYH.d.mts +0 -29
  254. package/dist/infiniteQueryOptions-Bpz4mFYH.d.mts.map +0 -1
  255. package/dist/mutationOptions-BIOn3zne.cjs +0 -14
  256. package/dist/mutationOptions-BIOn3zne.cjs.map +0 -1
  257. package/dist/mutationOptions-BZS10WEJ.d.mts +0 -7
  258. package/dist/mutationOptions-BZS10WEJ.d.mts.map +0 -1
  259. package/dist/mutationOptions-C4emetVL.mjs +0 -8
  260. package/dist/mutationOptions-C4emetVL.mjs.map +0 -1
  261. package/dist/mutationOptions-Eid3aM1W.d.cts +0 -7
  262. package/dist/mutationOptions-Eid3aM1W.d.cts.map +0 -1
  263. package/dist/queryOptions-92vSd4eV.cjs +0 -22
  264. package/dist/queryOptions-92vSd4eV.cjs.map +0 -1
  265. package/dist/queryOptions-DILe-4vk.d.mts +0 -29
  266. package/dist/queryOptions-DILe-4vk.d.mts.map +0 -1
  267. package/dist/queryOptions-DNGHeGX5.d.cts +0 -29
  268. package/dist/queryOptions-DNGHeGX5.d.cts.map +0 -1
  269. package/dist/queryOptions-Dnf4-wlk.mjs +0 -17
  270. package/dist/queryOptions-Dnf4-wlk.mjs.map +0 -1
  271. package/dist/usePrefetchInfiniteQuery-B0_Ladyp.d.mts +0 -12
  272. package/dist/usePrefetchInfiniteQuery-B0_Ladyp.d.mts.map +0 -1
  273. package/dist/usePrefetchInfiniteQuery-BmZtlLeD.cjs +0 -20
  274. package/dist/usePrefetchInfiniteQuery-BmZtlLeD.cjs.map +0 -1
  275. package/dist/usePrefetchInfiniteQuery-CQSN-P9m.mjs +0 -15
  276. package/dist/usePrefetchInfiniteQuery-CQSN-P9m.mjs.map +0 -1
  277. package/dist/usePrefetchInfiniteQuery-CRwRctQH.d.cts +0 -12
  278. package/dist/usePrefetchInfiniteQuery-CRwRctQH.d.cts.map +0 -1
  279. package/dist/usePrefetchQuery-38O319FT.d.mts +0 -12
  280. package/dist/usePrefetchQuery-38O319FT.d.mts.map +0 -1
  281. package/dist/usePrefetchQuery-93Pltnzl.d.cts +0 -12
  282. package/dist/usePrefetchQuery-93Pltnzl.d.cts.map +0 -1
  283. package/dist/usePrefetchQuery-CtrJciA6.mjs +0 -15
  284. package/dist/usePrefetchQuery-CtrJciA6.mjs.map +0 -1
  285. package/dist/usePrefetchQuery-woiivAJc.cjs +0 -20
  286. package/dist/usePrefetchQuery-woiivAJc.cjs.map +0 -1
  287. package/dist/useSuspenseInfiniteQuery-Bh0nh8Kc.d.mts +0 -17
  288. package/dist/useSuspenseInfiniteQuery-Bh0nh8Kc.d.mts.map +0 -1
  289. package/dist/useSuspenseInfiniteQuery-CA0jmgbX.cjs +0 -22
  290. package/dist/useSuspenseInfiniteQuery-CA0jmgbX.cjs.map +0 -1
  291. package/dist/useSuspenseInfiniteQuery-DUxKOkCo.mjs +0 -17
  292. package/dist/useSuspenseInfiniteQuery-DUxKOkCo.mjs.map +0 -1
  293. package/dist/useSuspenseInfiniteQuery-xXu-A7cX.d.cts +0 -17
  294. package/dist/useSuspenseInfiniteQuery-xXu-A7cX.d.cts.map +0 -1
  295. package/dist/useSuspenseQueries-Bf0lSTWB.mjs +0 -17
  296. package/dist/useSuspenseQueries-Bf0lSTWB.mjs.map +0 -1
  297. package/dist/useSuspenseQueries-CHPLAyeb.d.cts +0 -37
  298. package/dist/useSuspenseQueries-CHPLAyeb.d.cts.map +0 -1
  299. package/dist/useSuspenseQueries-DqBaOI3L.cjs +0 -22
  300. package/dist/useSuspenseQueries-DqBaOI3L.cjs.map +0 -1
  301. package/dist/useSuspenseQueries-pfI8hFSM.d.mts +0 -37
  302. package/dist/useSuspenseQueries-pfI8hFSM.d.mts.map +0 -1
  303. package/dist/useSuspenseQuery-41ONxa6i.cjs +0 -22
  304. package/dist/useSuspenseQuery-41ONxa6i.cjs.map +0 -1
  305. package/dist/useSuspenseQuery-CVWQeHhd.mjs +0 -17
  306. package/dist/useSuspenseQuery-CVWQeHhd.mjs.map +0 -1
  307. package/dist/useSuspenseQuery-DG0Jz1Da.d.mts +0 -37
  308. package/dist/useSuspenseQuery-DG0Jz1Da.d.mts.map +0 -1
  309. package/dist/useSuspenseQuery-DiNomNWA.d.cts +0 -37
  310. package/dist/useSuspenseQuery-DiNomNWA.d.cts.map +0 -1
@@ -1,5 +1,33 @@
1
1
  'use client';
2
2
 
3
- const require_SuspenseQuery = require('./SuspenseQuery-DE4NKrqP.cjs');
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
- exports.SuspenseQuery = require_SuspenseQuery.SuspenseQuery;
8
+ //#region src/SuspenseQuery.tsx
9
+ const _excluded = ["children"];
10
+ /**
11
+ * We provide these components to clearly express what causes suspense at the same depth.
12
+ * `<SuspenseQuery/>` serves to make `useSuspenseQuery` easier to use in jsx.
13
+ * @see {@link https://suspensive.org/docs/react-query/SuspenseQuery Suspensive Docs}
14
+ * @example
15
+ * ```tsx
16
+ * import { SuspenseQuery } from '@suspensive/react-query'
17
+ *
18
+ * // You can use QueryOptions as props.
19
+ * <SuspenseQuery {...queryOptions()}>
20
+ * {({ data, isLoading }) => {
21
+ * return <></>
22
+ * }
23
+ * </SuspenseQuery>
24
+ * ```
25
+ */
26
+ const SuspenseQuery = (_ref) => {
27
+ let { children } = _ref;
28
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: children((0, _tanstack_react_query.useSuspenseQuery)(require_objectWithoutProperties._objectWithoutProperties(_ref, _excluded))) });
29
+ };
30
+
31
+ //#endregion
32
+ exports.SuspenseQuery = SuspenseQuery;
33
+ //# sourceMappingURL=SuspenseQuery.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SuspenseQuery.cjs","names":[],"sources":["../src/SuspenseQuery.tsx"],"sourcesContent":["'use client'\n\nimport {\n type QueryKey,\n type UseSuspenseQueryOptions,\n type UseSuspenseQueryResult,\n useSuspenseQuery,\n} 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 * `<SuspenseQuery/>` serves to make `useSuspenseQuery` easier to use in jsx.\n * @see {@link https://suspensive.org/docs/react-query/SuspenseQuery Suspensive Docs}\n * @example\n * ```tsx\n * import { SuspenseQuery } from '@suspensive/react-query'\n *\n * // You can use QueryOptions as props.\n * <SuspenseQuery {...queryOptions()}>\n * {({ data, isLoading }) => {\n * return <></>\n * }\n * </SuspenseQuery>\n * ```\n */\nexport const SuspenseQuery = <\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>({\n children,\n ...options\n}: UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {\n children: (queryResult: UseSuspenseQueryResult<TData, TError>) => ReactNode\n}) => <>{children(useSuspenseQuery(options))}</>\n"],"mappings":";;;;;;;;mBAgCE;;;;;;;;;;;;;;;;;AANF,MAAa,iBAKX,SAKI;KALJ,EACA;AAII,2FAAG,+HAAkC,CAAC,EAAI"}
@@ -1,2 +1,30 @@
1
- import { t as SuspenseQuery } from "./SuspenseQuery-D4IZU_Co.cjs";
2
- export { SuspenseQuery };
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import { QueryKey, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query";
3
+ import { ReactNode } from "react";
4
+
5
+ //#region src/SuspenseQuery.d.ts
6
+ /**
7
+ * We provide these components to clearly express what causes suspense at the same depth.
8
+ * `<SuspenseQuery/>` serves to make `useSuspenseQuery` easier to use in jsx.
9
+ * @see {@link https://suspensive.org/docs/react-query/SuspenseQuery Suspensive Docs}
10
+ * @example
11
+ * ```tsx
12
+ * import { SuspenseQuery } from '@suspensive/react-query'
13
+ *
14
+ * // You can use QueryOptions as props.
15
+ * <SuspenseQuery {...queryOptions()}>
16
+ * {({ data, isLoading }) => {
17
+ * return <></>
18
+ * }
19
+ * </SuspenseQuery>
20
+ * ```
21
+ */
22
+ declare const SuspenseQuery: <TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>({
23
+ children,
24
+ ...options
25
+ }: UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
26
+ children: (queryResult: UseSuspenseQueryResult<TData, TError>) => ReactNode;
27
+ }) => react_jsx_runtime0.JSX.Element;
28
+ //#endregion
29
+ export { SuspenseQuery };
30
+ //# sourceMappingURL=SuspenseQuery.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SuspenseQuery.d.cts","names":[],"sources":["../src/SuspenseQuery.tsx"],"mappings":";;;;;;;;AA0BA;;;;;;;;;;;;;cAAa,aAAA,qDAGH,YAAA,oBACU,QAAA,GAAW,QAAA;EAC7B,QAAA;EAAA,GAAA;AAAA,GAGC,uBAAA,CAAwB,YAAA,EAAc,MAAA,EAAQ,KAAA,EAAO,SAAA;EACtD,QAAA,GAAW,WAAA,EAAa,sBAAA,CAAuB,KAAA,EAAO,MAAA,MAAY,SAAA;AAAA,MACnE,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1,2 +1,30 @@
1
- import { t as SuspenseQuery } from "./SuspenseQuery-VjYG_b1z.mjs";
2
- export { SuspenseQuery };
1
+ import { QueryKey, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import { ReactNode } from "react";
4
+
5
+ //#region src/SuspenseQuery.d.ts
6
+ /**
7
+ * We provide these components to clearly express what causes suspense at the same depth.
8
+ * `<SuspenseQuery/>` serves to make `useSuspenseQuery` easier to use in jsx.
9
+ * @see {@link https://suspensive.org/docs/react-query/SuspenseQuery Suspensive Docs}
10
+ * @example
11
+ * ```tsx
12
+ * import { SuspenseQuery } from '@suspensive/react-query'
13
+ *
14
+ * // You can use QueryOptions as props.
15
+ * <SuspenseQuery {...queryOptions()}>
16
+ * {({ data, isLoading }) => {
17
+ * return <></>
18
+ * }
19
+ * </SuspenseQuery>
20
+ * ```
21
+ */
22
+ declare const SuspenseQuery: <TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>({
23
+ children,
24
+ ...options
25
+ }: UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {
26
+ children: (queryResult: UseSuspenseQueryResult<TData, TError>) => ReactNode;
27
+ }) => react_jsx_runtime0.JSX.Element;
28
+ //#endregion
29
+ export { SuspenseQuery };
30
+ //# sourceMappingURL=SuspenseQuery.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SuspenseQuery.d.mts","names":[],"sources":["../src/SuspenseQuery.tsx"],"mappings":";;;;;;;;AA0BA;;;;;;;;;;;;;cAAa,aAAA,qDAGH,YAAA,oBACU,QAAA,GAAW,QAAA;EAC7B,QAAA;EAAA,GAAA;AAAA,GAGC,uBAAA,CAAwB,YAAA,EAAc,MAAA,EAAQ,KAAA,EAAO,SAAA;EACtD,QAAA,GAAW,WAAA,EAAa,sBAAA,CAAuB,KAAA,EAAO,MAAA,MAAY,SAAA;AAAA,MACnE,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1,5 +1,32 @@
1
1
  'use client';
2
2
 
3
- import { t as SuspenseQuery } from "./SuspenseQuery-BWI24top.mjs";
3
+ import { t as _objectWithoutProperties } from "./objectWithoutProperties-CZk5Qmfh.mjs";
4
+ import { useSuspenseQuery } from "@tanstack/react-query";
5
+ import { Fragment, jsx } from "react/jsx-runtime";
4
6
 
5
- export { SuspenseQuery };
7
+ //#region src/SuspenseQuery.tsx
8
+ const _excluded = ["children"];
9
+ /**
10
+ * We provide these components to clearly express what causes suspense at the same depth.
11
+ * `<SuspenseQuery/>` serves to make `useSuspenseQuery` easier to use in jsx.
12
+ * @see {@link https://suspensive.org/docs/react-query/SuspenseQuery Suspensive Docs}
13
+ * @example
14
+ * ```tsx
15
+ * import { SuspenseQuery } from '@suspensive/react-query'
16
+ *
17
+ * // You can use QueryOptions as props.
18
+ * <SuspenseQuery {...queryOptions()}>
19
+ * {({ data, isLoading }) => {
20
+ * return <></>
21
+ * }
22
+ * </SuspenseQuery>
23
+ * ```
24
+ */
25
+ const SuspenseQuery = (_ref) => {
26
+ let { children } = _ref;
27
+ return /* @__PURE__ */ jsx(Fragment, { children: children(useSuspenseQuery(_objectWithoutProperties(_ref, _excluded))) });
28
+ };
29
+
30
+ //#endregion
31
+ export { SuspenseQuery };
32
+ //# sourceMappingURL=SuspenseQuery.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SuspenseQuery.mjs","names":[],"sources":["../src/SuspenseQuery.tsx"],"sourcesContent":["'use client'\n\nimport {\n type QueryKey,\n type UseSuspenseQueryOptions,\n type UseSuspenseQueryResult,\n useSuspenseQuery,\n} 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 * `<SuspenseQuery/>` serves to make `useSuspenseQuery` easier to use in jsx.\n * @see {@link https://suspensive.org/docs/react-query/SuspenseQuery Suspensive Docs}\n * @example\n * ```tsx\n * import { SuspenseQuery } from '@suspensive/react-query'\n *\n * // You can use QueryOptions as props.\n * <SuspenseQuery {...queryOptions()}>\n * {({ data, isLoading }) => {\n * return <></>\n * }\n * </SuspenseQuery>\n * ```\n */\nexport const SuspenseQuery = <\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>({\n children,\n ...options\n}: UseSuspenseQueryOptions<TQueryFnData, TError, TData, TQueryKey> & {\n children: (queryResult: UseSuspenseQueryResult<TData, TError>) => ReactNode\n}) => <>{children(useSuspenseQuery(options))}</>\n"],"mappings":";;;;;;;mBAgCE;;;;;;;;;;;;;;;;;AANF,MAAa,iBAKX,SAKI;KALJ,EACA;AAII,kDAAG,SAAS,2DAAyB,CAAC,EAAI"}
@@ -1,5 +1,16 @@
1
1
  'use client';
2
2
 
3
- const require_ClientOnly = require('../ClientOnly-Dvf8t__-.cjs');
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ let react_jsx_runtime = require("react/jsx-runtime");
5
+ let react = require("react");
4
6
 
5
- exports.ClientOnly = require_ClientOnly.ClientOnly;
7
+ //#region src/components/ClientOnly.tsx
8
+ const useIsClient = () => (0, react.useSyncExternalStore)(emptySubscribe, getSnapshot, getServerSnapshot);
9
+ const emptySubscribe = () => () => {};
10
+ const getSnapshot = () => true;
11
+ const getServerSnapshot = () => false;
12
+ const ClientOnly = ({ children, fallback }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: useIsClient() ? children : fallback });
13
+
14
+ //#endregion
15
+ exports.ClientOnly = ClientOnly;
16
+ //# sourceMappingURL=ClientOnly.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientOnly.cjs","names":[],"sources":["../../src/components/ClientOnly.tsx"],"sourcesContent":["'use client'\n\nimport { useSyncExternalStore } from 'react'\n\nconst useIsClient = () => useSyncExternalStore(emptySubscribe, getSnapshot, getServerSnapshot)\n\nconst emptySubscribe = () => () => {}\nconst getSnapshot = () => true\nconst getServerSnapshot = () => false\n\nexport const ClientOnly = ({ children, fallback }: { children: React.ReactNode; fallback: React.ReactNode }) => (\n <>{useIsClient() ? children : fallback}</>\n)\n"],"mappings":";;;;;;;AAIA,MAAM,oDAAyC,gBAAgB,aAAa,kBAAkB;AAE9F,MAAM,6BAA6B;AACnC,MAAM,oBAAoB;AAC1B,MAAM,0BAA0B;AAEhC,MAAa,cAAc,EAAE,UAAU,eACrC,mFAAG,aAAa,GAAG,WAAW,UAAY"}
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime7 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/ClientOnly.d.ts
4
4
  declare const ClientOnly: ({
@@ -7,7 +7,7 @@ declare const ClientOnly: ({
7
7
  }: {
8
8
  children: React.ReactNode;
9
9
  fallback: React.ReactNode;
10
- }) => react_jsx_runtime7.JSX.Element;
10
+ }) => react_jsx_runtime0.JSX.Element;
11
11
  //#endregion
12
12
  export { ClientOnly };
13
13
  //# sourceMappingURL=ClientOnly.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClientOnly.d.cts","names":[],"sources":["../../src/components/ClientOnly.tsx"],"sourcesContent":[],"mappings":";;;cAUa;;;AAAb;YAA+D,KAAA,CAAM;YAAqB,KAAA,CAAM;AAAhG,CAAA,EAAA,GAA2G,kBAAA,CAAA,GAAA,CAAA,OAE1G"}
1
+ {"version":3,"file":"ClientOnly.d.cts","names":[],"sources":["../../src/components/ClientOnly.tsx"],"mappings":";;;cAUa,UAAA;EAAc,QAAA;EAAA;AAAA;EAA0B,QAAA,EAAU,KAAA,CAAM,SAAA;EAAW,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA,MAAW,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime6 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/ClientOnly.d.ts
4
4
  declare const ClientOnly: ({
@@ -7,7 +7,7 @@ declare const ClientOnly: ({
7
7
  }: {
8
8
  children: React.ReactNode;
9
9
  fallback: React.ReactNode;
10
- }) => react_jsx_runtime6.JSX.Element;
10
+ }) => react_jsx_runtime0.JSX.Element;
11
11
  //#endregion
12
12
  export { ClientOnly };
13
13
  //# sourceMappingURL=ClientOnly.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClientOnly.d.mts","names":[],"sources":["../../src/components/ClientOnly.tsx"],"sourcesContent":[],"mappings":";;;cAUa;;;AAAb;YAA+D,KAAA,CAAM;YAAqB,KAAA,CAAM;AAAhG,CAAA,EAAA,GAA2G,kBAAA,CAAA,GAAA,CAAA,OAE1G"}
1
+ {"version":3,"file":"ClientOnly.d.mts","names":[],"sources":["../../src/components/ClientOnly.tsx"],"mappings":";;;cAUa,UAAA;EAAc,QAAA;EAAA;AAAA;EAA0B,QAAA,EAAU,KAAA,CAAM,SAAA;EAAW,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA,MAAW,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1,5 +1,15 @@
1
1
  'use client';
2
2
 
3
- import { t as ClientOnly } from "../ClientOnly-BdmzVYnI.mjs";
3
+ import { Fragment, jsx } from "react/jsx-runtime";
4
+ import { useSyncExternalStore } from "react";
4
5
 
5
- export { ClientOnly };
6
+ //#region src/components/ClientOnly.tsx
7
+ const useIsClient = () => useSyncExternalStore(emptySubscribe, getSnapshot, getServerSnapshot);
8
+ const emptySubscribe = () => () => {};
9
+ const getSnapshot = () => true;
10
+ const getServerSnapshot = () => false;
11
+ const ClientOnly = ({ children, fallback }) => /* @__PURE__ */ jsx(Fragment, { children: useIsClient() ? children : fallback });
12
+
13
+ //#endregion
14
+ export { ClientOnly };
15
+ //# sourceMappingURL=ClientOnly.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClientOnly.mjs","names":[],"sources":["../../src/components/ClientOnly.tsx"],"sourcesContent":["'use client'\n\nimport { useSyncExternalStore } from 'react'\n\nconst useIsClient = () => useSyncExternalStore(emptySubscribe, getSnapshot, getServerSnapshot)\n\nconst emptySubscribe = () => () => {}\nconst getSnapshot = () => true\nconst getServerSnapshot = () => false\n\nexport const ClientOnly = ({ children, fallback }: { children: React.ReactNode; fallback: React.ReactNode }) => (\n <>{useIsClient() ? children : fallback}</>\n)\n"],"mappings":";;;;;;AAIA,MAAM,oBAAoB,qBAAqB,gBAAgB,aAAa,kBAAkB;AAE9F,MAAM,6BAA6B;AACnC,MAAM,oBAAoB;AAC1B,MAAM,0BAA0B;AAEhC,MAAa,cAAc,EAAE,UAAU,eACrC,0CAAG,aAAa,GAAG,WAAW,UAAY"}
@@ -1,3 +1,64 @@
1
- const require_createGetQueryClient = require('./createGetQueryClient-nXvPqrrS.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_objectSpread2 = require('./objectSpread2-9HkiXZY2.cjs');
3
+ let _tanstack_react_query = require("@tanstack/react-query");
2
4
 
3
- exports.createGetQueryClient = require_createGetQueryClient.createGetQueryClient;
5
+ //#region src/createGetQueryClient.ts
6
+ /**
7
+ * Creates a function that returns a QueryClient instance, with different behavior for server and client environments.
8
+ *
9
+ * On the server, it always creates a new QueryClient instance with `cacheTime: Infinity` to prevent data from being garbage collected.
10
+ * On the client, it reuses the same QueryClient instance to avoid recreating it during React's initial render suspension.
11
+ *
12
+ * @experimental This component is experimental and may be changed or removed in the future.
13
+ *
14
+ * @param config - Optional QueryClient configuration. On the server, `cacheTime` will be automatically set to `Infinity`.
15
+ * @returns An object containing a `getQueryClient` function that returns a QueryClient instance.
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * // Create a get-query-client.ts file in your project:
20
+ * // get-query-client.ts
21
+ * import { createGetQueryClient } from '@suspensive/react-query'
22
+ *
23
+ * export const { getQueryClient } = createGetQueryClient()
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * // Then import and use it in your code:
28
+ * // app/providers.tsx
29
+ * 'use client'
30
+ *
31
+ * import { QueryClientProvider } from '@tanstack/react-query'
32
+ * import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
33
+ * import { getQueryClient } from '@/app/get-query-client'
34
+ * import type * as React from 'react'
35
+ *
36
+ * export default function Providers({ children }: { children: React.ReactNode }) {
37
+ * const queryClient = getQueryClient()
38
+ *
39
+ * return (
40
+ * <QueryClientProvider client={queryClient}>
41
+ * {children}
42
+ * <ReactQueryDevtools />
43
+ * </QueryClientProvider>
44
+ * )
45
+ * }
46
+ * ```
47
+ *
48
+ * @see {@link https://suspensive.org/docs/react-query/createGetQueryClient Suspensive Docs}
49
+ */
50
+ function createGetQueryClient(config = {}) {
51
+ var _config$defaultOption;
52
+ let browserQueryClient;
53
+ const getQueryClientConfig = _tanstack_react_query.isServer ? require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, config), {}, { defaultOptions: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, config.defaultOptions), {}, { queries: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, (_config$defaultOption = config.defaultOptions) === null || _config$defaultOption === void 0 ? void 0 : _config$defaultOption.queries), {}, { cacheTime: Infinity }) }) }) : config;
54
+ function getQueryClient() {
55
+ if (_tanstack_react_query.isServer) return new _tanstack_react_query.QueryClient(getQueryClientConfig);
56
+ if (!browserQueryClient) browserQueryClient = new _tanstack_react_query.QueryClient(getQueryClientConfig);
57
+ return browserQueryClient;
58
+ }
59
+ return { getQueryClient };
60
+ }
61
+
62
+ //#endregion
63
+ exports.createGetQueryClient = createGetQueryClient;
64
+ //# sourceMappingURL=createGetQueryClient.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGetQueryClient.cjs","names":["isServer","QueryClient"],"sources":["../src/createGetQueryClient.ts"],"sourcesContent":["import { QueryClient, type QueryClientConfig, isServer } from '@tanstack/react-query'\n\n/**\n * Creates a function that returns a QueryClient instance, with different behavior for server and client environments.\n *\n * On the server, it always creates a new QueryClient instance with `cacheTime: Infinity` to prevent data from being garbage collected.\n * On the client, it reuses the same QueryClient instance to avoid recreating it during React's initial render suspension.\n *\n * @experimental This component is experimental and may be changed or removed in the future.\n *\n * @param config - Optional QueryClient configuration. On the server, `cacheTime` will be automatically set to `Infinity`.\n * @returns An object containing a `getQueryClient` function that returns a QueryClient instance.\n *\n * @example\n * ```tsx\n * // Create a get-query-client.ts file in your project:\n * // get-query-client.ts\n * import { createGetQueryClient } from '@suspensive/react-query'\n *\n * export const { getQueryClient } = createGetQueryClient()\n *\n * @example\n * ```tsx\n * // Then import and use it in your code:\n * // app/providers.tsx\n * 'use client'\n *\n * import { QueryClientProvider } from '@tanstack/react-query'\n * import { ReactQueryDevtools } from '@tanstack/react-query-devtools'\n * import { getQueryClient } from '@/app/get-query-client'\n * import type * as React from 'react'\n *\n * export default function Providers({ children }: { children: React.ReactNode }) {\n * const queryClient = getQueryClient()\n *\n * return (\n * <QueryClientProvider client={queryClient}>\n * {children}\n * <ReactQueryDevtools />\n * </QueryClientProvider>\n * )\n * }\n * ```\n *\n * @see {@link https://suspensive.org/docs/react-query/createGetQueryClient Suspensive Docs}\n */\nexport function createGetQueryClient(config: QueryClientConfig = {}) {\n let browserQueryClient: QueryClient | undefined\n const getQueryClientConfig: QueryClientConfig = isServer\n ? {\n ...config,\n defaultOptions: {\n ...config.defaultOptions,\n queries: {\n ...config.defaultOptions?.queries,\n cacheTime: Infinity,\n },\n },\n }\n : config\n\n function getQueryClient() {\n if (isServer) {\n // Server: always make a new query client\n return new QueryClient(getQueryClientConfig)\n }\n // Browser: make a new query client if we don't already have one\n // This is very important, so we don't re-make a new client if React\n // suspends during the initial render. This may not be needed if we\n // have a suspense boundary BELOW the creation of the query client\n if (!browserQueryClient) {\n browserQueryClient = new QueryClient(getQueryClientConfig)\n }\n return browserQueryClient\n }\n\n return { getQueryClient }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,qBAAqB,SAA4B,EAAE,EAAE;;CACnE,IAAI;CACJ,MAAM,uBAA0CA,+GAEvC,eACH,8FACK,OAAO,uBACV,gHACK,OAAO,8FAAgB,gBAC1B,WAAW,WACZ,GACF,GACF,GACD;CAEJ,SAAS,iBAAiB;AACxB,MAAIA,+BAEF,QAAO,IAAIC,kCAAY,qBAAqB;AAM9C,MAAI,CAAC,mBACH,sBAAqB,IAAIA,kCAAY,qBAAqB;AAE5D,SAAO;;AAGT,QAAO,EAAE,gBAAgB"}
@@ -1,2 +1,53 @@
1
- import { t as createGetQueryClient } from "./createGetQueryClient-iXoXO7so.cjs";
2
- export { createGetQueryClient };
1
+ import { QueryClient, QueryClientConfig } from "@tanstack/react-query";
2
+
3
+ //#region src/createGetQueryClient.d.ts
4
+ /**
5
+ * Creates a function that returns a QueryClient instance, with different behavior for server and client environments.
6
+ *
7
+ * On the server, it always creates a new QueryClient instance with `cacheTime: Infinity` to prevent data from being garbage collected.
8
+ * On the client, it reuses the same QueryClient instance to avoid recreating it during React's initial render suspension.
9
+ *
10
+ * @experimental This component is experimental and may be changed or removed in the future.
11
+ *
12
+ * @param config - Optional QueryClient configuration. On the server, `cacheTime` will be automatically set to `Infinity`.
13
+ * @returns An object containing a `getQueryClient` function that returns a QueryClient instance.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * // Create a get-query-client.ts file in your project:
18
+ * // get-query-client.ts
19
+ * import { createGetQueryClient } from '@suspensive/react-query'
20
+ *
21
+ * export const { getQueryClient } = createGetQueryClient()
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * // Then import and use it in your code:
26
+ * // app/providers.tsx
27
+ * 'use client'
28
+ *
29
+ * import { QueryClientProvider } from '@tanstack/react-query'
30
+ * import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
31
+ * import { getQueryClient } from '@/app/get-query-client'
32
+ * import type * as React from 'react'
33
+ *
34
+ * export default function Providers({ children }: { children: React.ReactNode }) {
35
+ * const queryClient = getQueryClient()
36
+ *
37
+ * return (
38
+ * <QueryClientProvider client={queryClient}>
39
+ * {children}
40
+ * <ReactQueryDevtools />
41
+ * </QueryClientProvider>
42
+ * )
43
+ * }
44
+ * ```
45
+ *
46
+ * @see {@link https://suspensive.org/docs/react-query/createGetQueryClient Suspensive Docs}
47
+ */
48
+ declare function createGetQueryClient(config?: QueryClientConfig): {
49
+ getQueryClient: () => QueryClient;
50
+ };
51
+ //#endregion
52
+ export { createGetQueryClient };
53
+ //# sourceMappingURL=createGetQueryClient.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGetQueryClient.d.cts","names":[],"sources":["../src/createGetQueryClient.ts"],"mappings":";;;;;AA8CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,oBAAA,CAAqB,MAAA,GAAQ,iBAAA;wBAAA,WAAA;AAAA"}
@@ -1,2 +1,53 @@
1
- import { t as createGetQueryClient } from "./createGetQueryClient-DTKVVwpJ.mjs";
2
- export { createGetQueryClient };
1
+ import { QueryClient, QueryClientConfig } from "@tanstack/react-query";
2
+
3
+ //#region src/createGetQueryClient.d.ts
4
+ /**
5
+ * Creates a function that returns a QueryClient instance, with different behavior for server and client environments.
6
+ *
7
+ * On the server, it always creates a new QueryClient instance with `cacheTime: Infinity` to prevent data from being garbage collected.
8
+ * On the client, it reuses the same QueryClient instance to avoid recreating it during React's initial render suspension.
9
+ *
10
+ * @experimental This component is experimental and may be changed or removed in the future.
11
+ *
12
+ * @param config - Optional QueryClient configuration. On the server, `cacheTime` will be automatically set to `Infinity`.
13
+ * @returns An object containing a `getQueryClient` function that returns a QueryClient instance.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * // Create a get-query-client.ts file in your project:
18
+ * // get-query-client.ts
19
+ * import { createGetQueryClient } from '@suspensive/react-query'
20
+ *
21
+ * export const { getQueryClient } = createGetQueryClient()
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * // Then import and use it in your code:
26
+ * // app/providers.tsx
27
+ * 'use client'
28
+ *
29
+ * import { QueryClientProvider } from '@tanstack/react-query'
30
+ * import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
31
+ * import { getQueryClient } from '@/app/get-query-client'
32
+ * import type * as React from 'react'
33
+ *
34
+ * export default function Providers({ children }: { children: React.ReactNode }) {
35
+ * const queryClient = getQueryClient()
36
+ *
37
+ * return (
38
+ * <QueryClientProvider client={queryClient}>
39
+ * {children}
40
+ * <ReactQueryDevtools />
41
+ * </QueryClientProvider>
42
+ * )
43
+ * }
44
+ * ```
45
+ *
46
+ * @see {@link https://suspensive.org/docs/react-query/createGetQueryClient Suspensive Docs}
47
+ */
48
+ declare function createGetQueryClient(config?: QueryClientConfig): {
49
+ getQueryClient: () => QueryClient;
50
+ };
51
+ //#endregion
52
+ export { createGetQueryClient };
53
+ //# sourceMappingURL=createGetQueryClient.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGetQueryClient.d.mts","names":[],"sources":["../src/createGetQueryClient.ts"],"mappings":";;;;;AA8CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,oBAAA,CAAqB,MAAA,GAAQ,iBAAA;wBAAA,WAAA;AAAA"}
@@ -1,3 +1,63 @@
1
- import { t as createGetQueryClient } from "./createGetQueryClient-B0yrcyXF.mjs";
1
+ import { t as _objectSpread2 } from "./objectSpread2-BX3M3dlG.mjs";
2
+ import { QueryClient, isServer } from "@tanstack/react-query";
2
3
 
3
- export { createGetQueryClient };
4
+ //#region src/createGetQueryClient.ts
5
+ /**
6
+ * Creates a function that returns a QueryClient instance, with different behavior for server and client environments.
7
+ *
8
+ * On the server, it always creates a new QueryClient instance with `cacheTime: Infinity` to prevent data from being garbage collected.
9
+ * On the client, it reuses the same QueryClient instance to avoid recreating it during React's initial render suspension.
10
+ *
11
+ * @experimental This component is experimental and may be changed or removed in the future.
12
+ *
13
+ * @param config - Optional QueryClient configuration. On the server, `cacheTime` will be automatically set to `Infinity`.
14
+ * @returns An object containing a `getQueryClient` function that returns a QueryClient instance.
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * // Create a get-query-client.ts file in your project:
19
+ * // get-query-client.ts
20
+ * import { createGetQueryClient } from '@suspensive/react-query'
21
+ *
22
+ * export const { getQueryClient } = createGetQueryClient()
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * // Then import and use it in your code:
27
+ * // app/providers.tsx
28
+ * 'use client'
29
+ *
30
+ * import { QueryClientProvider } from '@tanstack/react-query'
31
+ * import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
32
+ * import { getQueryClient } from '@/app/get-query-client'
33
+ * import type * as React from 'react'
34
+ *
35
+ * export default function Providers({ children }: { children: React.ReactNode }) {
36
+ * const queryClient = getQueryClient()
37
+ *
38
+ * return (
39
+ * <QueryClientProvider client={queryClient}>
40
+ * {children}
41
+ * <ReactQueryDevtools />
42
+ * </QueryClientProvider>
43
+ * )
44
+ * }
45
+ * ```
46
+ *
47
+ * @see {@link https://suspensive.org/docs/react-query/createGetQueryClient Suspensive Docs}
48
+ */
49
+ function createGetQueryClient(config = {}) {
50
+ var _config$defaultOption;
51
+ let browserQueryClient;
52
+ const getQueryClientConfig = isServer ? _objectSpread2(_objectSpread2({}, config), {}, { defaultOptions: _objectSpread2(_objectSpread2({}, config.defaultOptions), {}, { queries: _objectSpread2(_objectSpread2({}, (_config$defaultOption = config.defaultOptions) === null || _config$defaultOption === void 0 ? void 0 : _config$defaultOption.queries), {}, { cacheTime: Infinity }) }) }) : config;
53
+ function getQueryClient() {
54
+ if (isServer) return new QueryClient(getQueryClientConfig);
55
+ if (!browserQueryClient) browserQueryClient = new QueryClient(getQueryClientConfig);
56
+ return browserQueryClient;
57
+ }
58
+ return { getQueryClient };
59
+ }
60
+
61
+ //#endregion
62
+ export { createGetQueryClient };
63
+ //# sourceMappingURL=createGetQueryClient.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGetQueryClient.mjs","names":[],"sources":["../src/createGetQueryClient.ts"],"sourcesContent":["import { QueryClient, type QueryClientConfig, isServer } from '@tanstack/react-query'\n\n/**\n * Creates a function that returns a QueryClient instance, with different behavior for server and client environments.\n *\n * On the server, it always creates a new QueryClient instance with `cacheTime: Infinity` to prevent data from being garbage collected.\n * On the client, it reuses the same QueryClient instance to avoid recreating it during React's initial render suspension.\n *\n * @experimental This component is experimental and may be changed or removed in the future.\n *\n * @param config - Optional QueryClient configuration. On the server, `cacheTime` will be automatically set to `Infinity`.\n * @returns An object containing a `getQueryClient` function that returns a QueryClient instance.\n *\n * @example\n * ```tsx\n * // Create a get-query-client.ts file in your project:\n * // get-query-client.ts\n * import { createGetQueryClient } from '@suspensive/react-query'\n *\n * export const { getQueryClient } = createGetQueryClient()\n *\n * @example\n * ```tsx\n * // Then import and use it in your code:\n * // app/providers.tsx\n * 'use client'\n *\n * import { QueryClientProvider } from '@tanstack/react-query'\n * import { ReactQueryDevtools } from '@tanstack/react-query-devtools'\n * import { getQueryClient } from '@/app/get-query-client'\n * import type * as React from 'react'\n *\n * export default function Providers({ children }: { children: React.ReactNode }) {\n * const queryClient = getQueryClient()\n *\n * return (\n * <QueryClientProvider client={queryClient}>\n * {children}\n * <ReactQueryDevtools />\n * </QueryClientProvider>\n * )\n * }\n * ```\n *\n * @see {@link https://suspensive.org/docs/react-query/createGetQueryClient Suspensive Docs}\n */\nexport function createGetQueryClient(config: QueryClientConfig = {}) {\n let browserQueryClient: QueryClient | undefined\n const getQueryClientConfig: QueryClientConfig = isServer\n ? {\n ...config,\n defaultOptions: {\n ...config.defaultOptions,\n queries: {\n ...config.defaultOptions?.queries,\n cacheTime: Infinity,\n },\n },\n }\n : config\n\n function getQueryClient() {\n if (isServer) {\n // Server: always make a new query client\n return new QueryClient(getQueryClientConfig)\n }\n // Browser: make a new query client if we don't already have one\n // This is very important, so we don't re-make a new client if React\n // suspends during the initial render. This may not be needed if we\n // have a suspense boundary BELOW the creation of the query client\n if (!browserQueryClient) {\n browserQueryClient = new QueryClient(getQueryClientConfig)\n }\n return browserQueryClient\n }\n\n return { getQueryClient }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,qBAAqB,SAA4B,EAAE,EAAE;;CACnE,IAAI;CACJ,MAAM,uBAA0C,6CAEvC,eACH,kDACK,OAAO,uBACV,oEACK,OAAO,8FAAgB,gBAC1B,WAAW,WACZ,GACF,GACF,GACD;CAEJ,SAAS,iBAAiB;AACxB,MAAI,SAEF,QAAO,IAAI,YAAY,qBAAqB;AAM9C,MAAI,CAAC,mBACH,sBAAqB,IAAI,YAAY,qBAAqB;AAE5D,SAAO;;AAGT,QAAO,EAAE,gBAAgB"}
package/dist/index.cjs CHANGED
@@ -1,21 +1,22 @@
1
- const require_IsFetching = require('./IsFetching-BhOgGqrs.cjs');
2
- const require_Mutation = require('./Mutation-CGUYEkKX.cjs');
3
- const require_usePrefetchInfiniteQuery = require('./usePrefetchInfiniteQuery-BmZtlLeD.cjs');
4
- const require_PrefetchInfiniteQuery = require('./PrefetchInfiniteQuery-cCSXqKVR.cjs');
5
- const require_usePrefetchQuery = require('./usePrefetchQuery-woiivAJc.cjs');
6
- const require_PrefetchQuery = require('./PrefetchQuery-0pdYNtpS.cjs');
7
- const require_QueriesHydration = require('./QueriesHydration-dcSAzQNT.cjs');
8
- const require_QueryClientConsumer = require('./QueryClientConsumer-mF0OUwkq.cjs');
9
- const require_SuspenseInfiniteQuery = require('./SuspenseInfiniteQuery-oVQE2P2T.cjs');
10
- const require_SuspenseQueries = require('./SuspenseQueries-Brk6gtMw.cjs');
11
- const require_SuspenseQuery = require('./SuspenseQuery-DE4NKrqP.cjs');
12
- const require_createGetQueryClient = require('./createGetQueryClient-nXvPqrrS.cjs');
13
- const require_infiniteQueryOptions = require('./infiniteQueryOptions-BVac5B-c.cjs');
14
- const require_queryOptions = require('./queryOptions-92vSd4eV.cjs');
15
- const require_useSuspenseInfiniteQuery = require('./useSuspenseInfiniteQuery-CA0jmgbX.cjs');
16
- const require_useSuspenseQueries = require('./useSuspenseQueries-DqBaOI3L.cjs');
17
- const require_useSuspenseQuery = require('./useSuspenseQuery-41ONxa6i.cjs');
18
- const require_mutationOptions = require('./mutationOptions-BIOn3zne.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_IsFetching = require('./IsFetching.cjs');
3
+ const require_Mutation = require('./Mutation.cjs');
4
+ const require_usePrefetchInfiniteQuery = require('./usePrefetchInfiniteQuery.cjs');
5
+ const require_PrefetchInfiniteQuery = require('./PrefetchInfiniteQuery.cjs');
6
+ const require_usePrefetchQuery = require('./usePrefetchQuery.cjs');
7
+ const require_PrefetchQuery = require('./PrefetchQuery.cjs');
8
+ const require_QueriesHydration = require('./QueriesHydration-B9tinfWA.cjs');
9
+ const require_QueryClientConsumer = require('./QueryClientConsumer.cjs');
10
+ const require_SuspenseInfiniteQuery = require('./SuspenseInfiniteQuery.cjs');
11
+ const require_SuspenseQueries = require('./SuspenseQueries.cjs');
12
+ const require_SuspenseQuery = require('./SuspenseQuery.cjs');
13
+ const require_createGetQueryClient = require('./createGetQueryClient.cjs');
14
+ const require_infiniteQueryOptions = require('./infiniteQueryOptions.cjs');
15
+ const require_queryOptions = require('./queryOptions.cjs');
16
+ const require_useSuspenseInfiniteQuery = require('./useSuspenseInfiniteQuery.cjs');
17
+ const require_useSuspenseQueries = require('./useSuspenseQueries.cjs');
18
+ const require_useSuspenseQuery = require('./useSuspenseQuery.cjs');
19
+ const require_mutationOptions = require('./mutationOptions.cjs');
19
20
 
20
21
  exports.IsFetching = require_IsFetching.IsFetching;
21
22
  exports.Mutation = require_Mutation.Mutation;
package/dist/index.d.cts CHANGED
@@ -1,19 +1,19 @@
1
- import { t as IsFetching } from "./IsFetching-CuftXnaJ.cjs";
2
- import { t as Mutation } from "./Mutation-DGmP7HQI.cjs";
3
- import { t as PrefetchInfiniteQuery } from "./PrefetchInfiniteQuery-BewcG5rR.cjs";
4
- import { t as PrefetchQuery } from "./PrefetchQuery-Ddbt43Fk.cjs";
5
- import { t as QueriesHydration } from "./QueriesHydration-DnlRrHJ3.cjs";
6
- import { t as QueryClientConsumer } from "./QueryClientConsumer-pihgMOoA.cjs";
7
- import { n as UseSuspenseInfiniteQueryResult, r as useSuspenseInfiniteQuery, t as UseSuspenseInfiniteQueryOptions } from "./useSuspenseInfiniteQuery-xXu-A7cX.cjs";
8
- import { t as SuspenseInfiniteQuery } from "./SuspenseInfiniteQuery-DSYC5XON.cjs";
9
- import { t as SuspenseQueries } from "./SuspenseQueries-BPvriygJ.cjs";
10
- import { t as SuspenseQuery } from "./SuspenseQuery-D4IZU_Co.cjs";
11
- import { t as createGetQueryClient } from "./createGetQueryClient-iXoXO7so.cjs";
12
- import { n as UnSelectedInfiniteOptions, r as infiniteQueryOptions, t as SelectedInfiniteOptions } from "./infiniteQueryOptions-Be7VYTUR.cjs";
13
- import { n as UnSelectedQueryOptions, r as queryOptions, t as SelectedQueryOptions } from "./queryOptions-DNGHeGX5.cjs";
14
- import { t as usePrefetchInfiniteQuery } from "./usePrefetchInfiniteQuery-CRwRctQH.cjs";
15
- import { t as usePrefetchQuery } from "./usePrefetchQuery-93Pltnzl.cjs";
16
- import { n as SuspenseQueriesResults, r as useSuspenseQueries, t as SuspenseQueriesOptions } from "./useSuspenseQueries-CHPLAyeb.cjs";
17
- import { n as UseSuspenseQueryResult, r as useSuspenseQuery, t as UseSuspenseQueryOptions } from "./useSuspenseQuery-DiNomNWA.cjs";
18
- import { t as mutationOptions } from "./mutationOptions-Eid3aM1W.cjs";
1
+ import { IsFetching } from "./IsFetching.cjs";
2
+ import { Mutation } from "./Mutation.cjs";
3
+ import { PrefetchInfiniteQuery } from "./PrefetchInfiniteQuery.cjs";
4
+ import { PrefetchQuery } from "./PrefetchQuery.cjs";
5
+ import { QueriesHydration } from "./QueriesHydration.cjs";
6
+ import { QueryClientConsumer } from "./QueryClientConsumer.cjs";
7
+ import { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, useSuspenseInfiniteQuery } from "./useSuspenseInfiniteQuery.cjs";
8
+ import { SuspenseInfiniteQuery } from "./SuspenseInfiniteQuery.cjs";
9
+ import { SuspenseQueries } from "./SuspenseQueries.cjs";
10
+ import { SuspenseQuery } from "./SuspenseQuery.cjs";
11
+ import { createGetQueryClient } from "./createGetQueryClient.cjs";
12
+ import { SelectedInfiniteOptions, UnSelectedInfiniteOptions, infiniteQueryOptions } from "./infiniteQueryOptions.cjs";
13
+ import { SelectedQueryOptions, UnSelectedQueryOptions, queryOptions } from "./queryOptions.cjs";
14
+ import { usePrefetchInfiniteQuery } from "./usePrefetchInfiniteQuery.cjs";
15
+ import { usePrefetchQuery } from "./usePrefetchQuery.cjs";
16
+ import { SuspenseQueriesOptions, SuspenseQueriesResults, useSuspenseQueries } from "./useSuspenseQueries.cjs";
17
+ import { UseSuspenseQueryOptions, UseSuspenseQueryResult, useSuspenseQuery } from "./useSuspenseQuery.cjs";
18
+ import { mutationOptions } from "./mutationOptions.cjs";
19
19
  export { IsFetching, Mutation, PrefetchInfiniteQuery, PrefetchQuery, QueriesHydration, QueryClientConsumer, type SelectedInfiniteOptions, type SelectedQueryOptions, SuspenseInfiniteQuery, SuspenseQueries, type SuspenseQueriesOptions, type SuspenseQueriesResults, SuspenseQuery, type UnSelectedInfiniteOptions, type UnSelectedQueryOptions, type UseSuspenseInfiniteQueryOptions, type UseSuspenseInfiniteQueryResult, type UseSuspenseQueryOptions, type UseSuspenseQueryResult, createGetQueryClient, infiniteQueryOptions, mutationOptions, queryOptions, usePrefetchInfiniteQuery, usePrefetchQuery, useSuspenseInfiniteQuery, useSuspenseQueries, useSuspenseQuery };