@tanstack/query-core 5.105.0 → 5.105.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/build/legacy/{classPrivateFieldSet2-CukOTU3U.js → classPrivateFieldSet2-CWIQ5CvM.js} +5 -10
  2. package/build/legacy/{classPrivateFieldSet2-CvCEk6bM.cjs → classPrivateFieldSet2-C_J9s9he.cjs} +5 -10
  3. package/build/legacy/{classPrivateMethodInitSpec-Nr6mgZRs.cjs → classPrivateMethodInitSpec-BMGv9vbZ.cjs} +2 -3
  4. package/build/legacy/{classPrivateMethodInitSpec-CgB-WYk3.js → classPrivateMethodInitSpec-DipaBicy.js} +2 -3
  5. package/build/legacy/environmentManager.cjs +1 -2
  6. package/build/legacy/environmentManager.d.cts +0 -2
  7. package/build/legacy/environmentManager.d.cts.map +1 -1
  8. package/build/legacy/environmentManager.d.ts +0 -2
  9. package/build/legacy/environmentManager.d.ts.map +1 -1
  10. package/build/legacy/environmentManager.js +1 -2
  11. package/build/legacy/focusManager.cjs +2 -3
  12. package/build/legacy/focusManager.d.cts +1 -3
  13. package/build/legacy/focusManager.d.cts.map +1 -1
  14. package/build/legacy/focusManager.d.ts +1 -3
  15. package/build/legacy/focusManager.d.ts.map +1 -1
  16. package/build/legacy/focusManager.js +2 -3
  17. package/build/{modern/hydration-CS3HS-a9.d.ts → legacy/hydration-BXjqUj_D.d.cts} +28 -39
  18. package/build/legacy/hydration-BXjqUj_D.d.cts.map +1 -0
  19. package/build/legacy/{hydration-CS3HS-a9.d.ts → hydration-vgIjIhk6.d.ts} +28 -39
  20. package/build/legacy/hydration-vgIjIhk6.d.ts.map +1 -0
  21. package/build/legacy/hydration.cjs +1 -2
  22. package/build/legacy/hydration.d.cts +1 -1
  23. package/build/legacy/hydration.d.ts +1 -1
  24. package/build/legacy/hydration.js +1 -2
  25. package/build/legacy/index.cjs +1 -2
  26. package/build/legacy/index.d.cts +1 -1
  27. package/build/legacy/index.d.ts +1 -1
  28. package/build/legacy/index.js +1 -2
  29. package/build/legacy/infiniteQueryBehavior.cjs +3 -3
  30. package/build/legacy/infiniteQueryBehavior.cjs.map +1 -1
  31. package/build/legacy/infiniteQueryBehavior.d.cts +1 -3
  32. package/build/legacy/infiniteQueryBehavior.d.cts.map +1 -1
  33. package/build/legacy/infiniteQueryBehavior.d.ts +1 -3
  34. package/build/legacy/infiniteQueryBehavior.d.ts.map +1 -1
  35. package/build/legacy/infiniteQueryBehavior.js +4 -4
  36. package/build/legacy/infiniteQueryBehavior.js.map +1 -1
  37. package/build/legacy/infiniteQueryObserver.cjs +1 -2
  38. package/build/legacy/infiniteQueryObserver.d.cts +2 -4
  39. package/build/legacy/infiniteQueryObserver.d.cts.map +1 -1
  40. package/build/legacy/infiniteQueryObserver.d.ts +2 -4
  41. package/build/legacy/infiniteQueryObserver.d.ts.map +1 -1
  42. package/build/legacy/infiniteQueryObserver.js +1 -2
  43. package/build/legacy/mutation.cjs +4 -4
  44. package/build/legacy/mutation.cjs.map +1 -1
  45. package/build/legacy/mutation.d.cts +1 -1
  46. package/build/legacy/mutation.d.ts +1 -1
  47. package/build/legacy/mutation.js +4 -4
  48. package/build/legacy/mutation.js.map +1 -1
  49. package/build/legacy/mutationCache.cjs +2 -3
  50. package/build/legacy/mutationCache.d.cts +1 -1
  51. package/build/legacy/mutationCache.d.ts +1 -1
  52. package/build/legacy/mutationCache.js +2 -3
  53. package/build/legacy/mutationObserver.cjs +3 -4
  54. package/build/legacy/mutationObserver.d.cts +1 -1
  55. package/build/legacy/mutationObserver.d.ts +1 -1
  56. package/build/legacy/mutationObserver.js +3 -4
  57. package/build/legacy/notifyManager.cjs +1 -2
  58. package/build/legacy/notifyManager.cjs.map +1 -1
  59. package/build/legacy/notifyManager.d.cts +0 -2
  60. package/build/legacy/notifyManager.d.cts.map +1 -1
  61. package/build/legacy/notifyManager.d.ts +0 -2
  62. package/build/legacy/notifyManager.d.ts.map +1 -1
  63. package/build/legacy/notifyManager.js +1 -2
  64. package/build/legacy/onlineManager.cjs +2 -3
  65. package/build/legacy/onlineManager.d.cts +1 -3
  66. package/build/legacy/onlineManager.d.cts.map +1 -1
  67. package/build/legacy/onlineManager.d.ts +1 -3
  68. package/build/legacy/onlineManager.d.ts.map +1 -1
  69. package/build/legacy/onlineManager.js +2 -3
  70. package/build/legacy/queriesObserver.cjs +3 -4
  71. package/build/legacy/queriesObserver.d.cts +2 -4
  72. package/build/legacy/queriesObserver.d.cts.map +1 -1
  73. package/build/legacy/queriesObserver.d.ts +2 -4
  74. package/build/legacy/queriesObserver.d.ts.map +1 -1
  75. package/build/legacy/queriesObserver.js +3 -4
  76. package/build/legacy/query.cjs +57 -40
  77. package/build/legacy/query.cjs.map +1 -1
  78. package/build/legacy/query.d.cts +1 -1
  79. package/build/legacy/query.d.ts +1 -1
  80. package/build/legacy/query.js +58 -41
  81. package/build/legacy/query.js.map +1 -1
  82. package/build/legacy/queryCache.cjs +2 -3
  83. package/build/legacy/queryCache.d.cts +1 -1
  84. package/build/legacy/queryCache.d.ts +1 -1
  85. package/build/legacy/queryCache.js +2 -3
  86. package/build/legacy/queryClient.cjs +13 -9
  87. package/build/legacy/queryClient.cjs.map +1 -1
  88. package/build/legacy/queryClient.d.cts +1 -1
  89. package/build/legacy/queryClient.d.ts +1 -1
  90. package/build/legacy/queryClient.js +13 -9
  91. package/build/legacy/queryClient.js.map +1 -1
  92. package/build/legacy/queryObserver.cjs +6 -10
  93. package/build/legacy/queryObserver.cjs.map +1 -1
  94. package/build/legacy/queryObserver.d.cts +1 -1
  95. package/build/legacy/queryObserver.d.ts +1 -1
  96. package/build/legacy/queryObserver.js +6 -10
  97. package/build/legacy/queryObserver.js.map +1 -1
  98. package/build/{modern/removable-Cw9GNGyK.d.ts → legacy/removable-B1nFbgZm.d.cts} +1 -3
  99. package/build/legacy/removable-B1nFbgZm.d.cts.map +1 -0
  100. package/build/legacy/{removable-Cw9GNGyK.d.ts → removable-B1nFbgZm.d.ts} +1 -3
  101. package/build/legacy/removable-B1nFbgZm.d.ts.map +1 -0
  102. package/build/legacy/removable.cjs +2 -3
  103. package/build/legacy/removable.d.cts +1 -1
  104. package/build/legacy/removable.d.ts +1 -1
  105. package/build/legacy/removable.js +2 -3
  106. package/build/legacy/retryer.cjs +1 -2
  107. package/build/legacy/retryer.d.cts +1 -1
  108. package/build/legacy/retryer.d.ts +1 -1
  109. package/build/legacy/retryer.js +1 -2
  110. package/build/legacy/streamedQuery.cjs +11 -6
  111. package/build/legacy/streamedQuery.cjs.map +1 -1
  112. package/build/legacy/streamedQuery.d.cts +3 -3
  113. package/build/legacy/streamedQuery.d.cts.map +1 -1
  114. package/build/legacy/streamedQuery.d.ts +3 -3
  115. package/build/legacy/streamedQuery.d.ts.map +1 -1
  116. package/build/legacy/streamedQuery.js +12 -7
  117. package/build/legacy/streamedQuery.js.map +1 -1
  118. package/build/legacy/{subscribable-czlHOxMP.d.ts → subscribable-D2lAzdDi.d.cts} +1 -3
  119. package/build/legacy/subscribable-D2lAzdDi.d.cts.map +1 -0
  120. package/build/{modern/subscribable-czlHOxMP.d.ts → legacy/subscribable-D2lAzdDi.d.ts} +1 -3
  121. package/build/legacy/subscribable-D2lAzdDi.d.ts.map +1 -0
  122. package/build/legacy/subscribable.cjs +1 -2
  123. package/build/legacy/subscribable.d.cts +1 -1
  124. package/build/legacy/subscribable.d.ts +1 -1
  125. package/build/legacy/subscribable.js +1 -2
  126. package/build/legacy/timeoutManager.cjs +2 -3
  127. package/build/legacy/timeoutManager.d.cts +0 -2
  128. package/build/legacy/timeoutManager.d.cts.map +1 -1
  129. package/build/legacy/timeoutManager.d.ts +0 -2
  130. package/build/legacy/timeoutManager.d.ts.map +1 -1
  131. package/build/legacy/timeoutManager.js +2 -3
  132. package/build/legacy/types.cjs +1 -2
  133. package/build/legacy/types.d.cts +1 -1
  134. package/build/legacy/types.d.ts +1 -1
  135. package/build/legacy/types.js +1 -2
  136. package/build/legacy/utils.cjs +24 -21
  137. package/build/legacy/utils.cjs.map +1 -1
  138. package/build/legacy/utils.d.cts +2 -2
  139. package/build/legacy/utils.d.ts +2 -2
  140. package/build/legacy/utils.js +24 -22
  141. package/build/legacy/utils.js.map +1 -1
  142. package/build/modern/environmentManager.cjs +1 -2
  143. package/build/modern/environmentManager.d.cts +0 -2
  144. package/build/modern/environmentManager.d.cts.map +1 -1
  145. package/build/modern/environmentManager.d.ts +0 -2
  146. package/build/modern/environmentManager.d.ts.map +1 -1
  147. package/build/modern/environmentManager.js +1 -2
  148. package/build/modern/focusManager.cjs +1 -2
  149. package/build/modern/focusManager.d.cts +1 -3
  150. package/build/modern/focusManager.d.cts.map +1 -1
  151. package/build/modern/focusManager.d.ts +1 -3
  152. package/build/modern/focusManager.d.ts.map +1 -1
  153. package/build/modern/focusManager.js +1 -2
  154. package/build/modern/{hydration-DhAJ02bL.d.cts → hydration-BXjqUj_D.d.cts} +28 -39
  155. package/build/modern/hydration-BXjqUj_D.d.cts.map +1 -0
  156. package/build/{legacy/hydration-DhAJ02bL.d.cts → modern/hydration-vgIjIhk6.d.ts} +28 -39
  157. package/build/modern/hydration-vgIjIhk6.d.ts.map +1 -0
  158. package/build/modern/hydration.cjs +1 -2
  159. package/build/modern/hydration.d.cts +1 -1
  160. package/build/modern/hydration.d.ts +1 -1
  161. package/build/modern/hydration.js +1 -2
  162. package/build/modern/index.cjs +1 -2
  163. package/build/modern/index.d.cts +1 -1
  164. package/build/modern/index.d.ts +1 -1
  165. package/build/modern/index.js +1 -2
  166. package/build/modern/infiniteQueryBehavior.cjs +3 -3
  167. package/build/modern/infiniteQueryBehavior.cjs.map +1 -1
  168. package/build/modern/infiniteQueryBehavior.d.cts +1 -3
  169. package/build/modern/infiniteQueryBehavior.d.cts.map +1 -1
  170. package/build/modern/infiniteQueryBehavior.d.ts +1 -3
  171. package/build/modern/infiniteQueryBehavior.d.ts.map +1 -1
  172. package/build/modern/infiniteQueryBehavior.js +4 -4
  173. package/build/modern/infiniteQueryBehavior.js.map +1 -1
  174. package/build/modern/infiniteQueryObserver.cjs +1 -2
  175. package/build/modern/infiniteQueryObserver.d.cts +2 -4
  176. package/build/modern/infiniteQueryObserver.d.cts.map +1 -1
  177. package/build/modern/infiniteQueryObserver.d.ts +2 -4
  178. package/build/modern/infiniteQueryObserver.d.ts.map +1 -1
  179. package/build/modern/infiniteQueryObserver.js +1 -2
  180. package/build/modern/mutation.cjs +2 -2
  181. package/build/modern/mutation.cjs.map +1 -1
  182. package/build/modern/mutation.d.cts +1 -1
  183. package/build/modern/mutation.d.ts +1 -1
  184. package/build/modern/mutation.js +2 -2
  185. package/build/modern/mutation.js.map +1 -1
  186. package/build/modern/mutationCache.cjs +1 -2
  187. package/build/modern/mutationCache.d.cts +1 -1
  188. package/build/modern/mutationCache.d.ts +1 -1
  189. package/build/modern/mutationCache.js +1 -2
  190. package/build/modern/mutationObserver.cjs +1 -2
  191. package/build/modern/mutationObserver.d.cts +1 -1
  192. package/build/modern/mutationObserver.d.ts +1 -1
  193. package/build/modern/mutationObserver.js +1 -2
  194. package/build/modern/notifyManager.cjs +1 -2
  195. package/build/modern/notifyManager.cjs.map +1 -1
  196. package/build/modern/notifyManager.d.cts +0 -2
  197. package/build/modern/notifyManager.d.cts.map +1 -1
  198. package/build/modern/notifyManager.d.ts +0 -2
  199. package/build/modern/notifyManager.d.ts.map +1 -1
  200. package/build/modern/notifyManager.js +1 -2
  201. package/build/modern/onlineManager.cjs +1 -2
  202. package/build/modern/onlineManager.d.cts +1 -3
  203. package/build/modern/onlineManager.d.cts.map +1 -1
  204. package/build/modern/onlineManager.d.ts +1 -3
  205. package/build/modern/onlineManager.d.ts.map +1 -1
  206. package/build/modern/onlineManager.js +1 -2
  207. package/build/modern/queriesObserver.cjs +1 -2
  208. package/build/modern/queriesObserver.d.cts +2 -4
  209. package/build/modern/queriesObserver.d.cts.map +1 -1
  210. package/build/modern/queriesObserver.d.ts +2 -4
  211. package/build/modern/queriesObserver.d.ts.map +1 -1
  212. package/build/modern/queriesObserver.js +1 -2
  213. package/build/modern/query.cjs +52 -36
  214. package/build/modern/query.cjs.map +1 -1
  215. package/build/modern/query.d.cts +1 -1
  216. package/build/modern/query.d.ts +1 -1
  217. package/build/modern/query.js +53 -37
  218. package/build/modern/query.js.map +1 -1
  219. package/build/modern/queryCache.cjs +1 -2
  220. package/build/modern/queryCache.d.cts +1 -1
  221. package/build/modern/queryCache.d.ts +1 -1
  222. package/build/modern/queryCache.js +1 -2
  223. package/build/modern/queryClient.cjs +12 -8
  224. package/build/modern/queryClient.cjs.map +1 -1
  225. package/build/modern/queryClient.d.cts +1 -1
  226. package/build/modern/queryClient.d.ts +1 -1
  227. package/build/modern/queryClient.js +12 -8
  228. package/build/modern/queryClient.js.map +1 -1
  229. package/build/modern/queryObserver.cjs +4 -8
  230. package/build/modern/queryObserver.cjs.map +1 -1
  231. package/build/modern/queryObserver.d.cts +1 -1
  232. package/build/modern/queryObserver.d.ts +1 -1
  233. package/build/modern/queryObserver.js +4 -8
  234. package/build/modern/queryObserver.js.map +1 -1
  235. package/build/modern/{removable-Cw9GNGyK.d.cts → removable-B1nFbgZm.d.cts} +1 -3
  236. package/build/modern/removable-B1nFbgZm.d.cts.map +1 -0
  237. package/build/{legacy/removable-Cw9GNGyK.d.cts → modern/removable-B1nFbgZm.d.ts} +1 -3
  238. package/build/modern/removable-B1nFbgZm.d.ts.map +1 -0
  239. package/build/modern/removable.cjs +1 -2
  240. package/build/modern/removable.d.cts +1 -1
  241. package/build/modern/removable.d.ts +1 -1
  242. package/build/modern/removable.js +1 -2
  243. package/build/modern/retryer.cjs +1 -2
  244. package/build/modern/retryer.d.cts +1 -1
  245. package/build/modern/retryer.d.ts +1 -1
  246. package/build/modern/retryer.js +1 -2
  247. package/build/modern/streamedQuery.cjs +11 -6
  248. package/build/modern/streamedQuery.cjs.map +1 -1
  249. package/build/modern/streamedQuery.d.cts +3 -3
  250. package/build/modern/streamedQuery.d.cts.map +1 -1
  251. package/build/modern/streamedQuery.d.ts +3 -3
  252. package/build/modern/streamedQuery.d.ts.map +1 -1
  253. package/build/modern/streamedQuery.js +12 -7
  254. package/build/modern/streamedQuery.js.map +1 -1
  255. package/build/{legacy/subscribable-czlHOxMP.d.cts → modern/subscribable-D2lAzdDi.d.cts} +1 -3
  256. package/build/modern/subscribable-D2lAzdDi.d.cts.map +1 -0
  257. package/build/modern/{subscribable-czlHOxMP.d.cts → subscribable-D2lAzdDi.d.ts} +1 -3
  258. package/build/modern/subscribable-D2lAzdDi.d.ts.map +1 -0
  259. package/build/modern/subscribable.cjs +1 -2
  260. package/build/modern/subscribable.d.cts +1 -1
  261. package/build/modern/subscribable.d.ts +1 -1
  262. package/build/modern/subscribable.js +1 -2
  263. package/build/modern/timeoutManager.cjs +1 -2
  264. package/build/modern/timeoutManager.d.cts +0 -2
  265. package/build/modern/timeoutManager.d.cts.map +1 -1
  266. package/build/modern/timeoutManager.d.ts +0 -2
  267. package/build/modern/timeoutManager.d.ts.map +1 -1
  268. package/build/modern/timeoutManager.js +1 -2
  269. package/build/modern/types.cjs +1 -2
  270. package/build/modern/types.d.cts +1 -1
  271. package/build/modern/types.d.ts +1 -1
  272. package/build/modern/types.js +1 -2
  273. package/build/modern/utils.cjs +24 -21
  274. package/build/modern/utils.cjs.map +1 -1
  275. package/build/modern/utils.d.cts +2 -2
  276. package/build/modern/utils.d.ts +2 -2
  277. package/build/modern/utils.js +24 -22
  278. package/build/modern/utils.js.map +1 -1
  279. package/package.json +1 -1
  280. package/src/infiniteQueryBehavior.ts +5 -1
  281. package/src/mutation.ts +4 -0
  282. package/src/query.ts +78 -64
  283. package/src/queryClient.ts +17 -13
  284. package/src/queryObserver.ts +14 -12
  285. package/src/streamedQuery.ts +14 -3
  286. package/src/utils.ts +39 -26
  287. package/build/legacy/hydration-CS3HS-a9.d.ts.map +0 -1
  288. package/build/legacy/hydration-DhAJ02bL.d.cts.map +0 -1
  289. package/build/legacy/removable-Cw9GNGyK.d.cts.map +0 -1
  290. package/build/legacy/removable-Cw9GNGyK.d.ts.map +0 -1
  291. package/build/legacy/subscribable-czlHOxMP.d.cts.map +0 -1
  292. package/build/legacy/subscribable-czlHOxMP.d.ts.map +0 -1
  293. package/build/modern/hydration-CS3HS-a9.d.ts.map +0 -1
  294. package/build/modern/hydration-DhAJ02bL.d.cts.map +0 -1
  295. package/build/modern/removable-Cw9GNGyK.d.cts.map +0 -1
  296. package/build/modern/removable-Cw9GNGyK.d.ts.map +0 -1
  297. package/build/modern/subscribable-czlHOxMP.d.cts.map +0 -1
  298. package/build/modern/subscribable-czlHOxMP.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- import { Gn as MutationCacheConfig, Kn as MutationCacheNotifyEvent, Wn as MutationCache } from "./hydration-DhAJ02bL.cjs";
1
+ import { Jn as MutationCacheNotifyEvent, Kn as MutationCache, qn as MutationCacheConfig } from "./hydration-BXjqUj_D.cjs";
2
2
  export { MutationCache, MutationCacheConfig, MutationCacheNotifyEvent };
@@ -1,2 +1,2 @@
1
- import { Gn as MutationCacheConfig, Kn as MutationCacheNotifyEvent, Wn as MutationCache } from "./hydration-CS3HS-a9.js";
1
+ import { Jn as MutationCacheNotifyEvent, Kn as MutationCache, qn as MutationCacheConfig } from "./hydration-vgIjIhk6.js";
2
2
  export { MutationCache, MutationCacheConfig, MutationCacheNotifyEvent };
@@ -2,7 +2,7 @@ import { matchMutation, noop } from "./utils.js";
2
2
  import { Subscribable } from "./subscribable.js";
3
3
  import { notifyManager } from "./notifyManager.js";
4
4
  import { Mutation } from "./mutation.js";
5
- //#region src/mutationCache.ts
5
+ // src/mutationCache.ts
6
6
  /**
7
7
  * The `MutationCache` is the storage for mutations.
8
8
  *
@@ -224,7 +224,6 @@ var MutationCache = class extends Subscribable {
224
224
  function scopeFor(mutation) {
225
225
  return mutation.options.scope?.id;
226
226
  }
227
- //#endregion
228
227
  export { MutationCache };
229
228
 
230
229
  //# sourceMappingURL=mutationCache.js.map
@@ -3,7 +3,7 @@ const require_utils = require("./utils.cjs");
3
3
  const require_subscribable = require("./subscribable.cjs");
4
4
  const require_notifyManager = require("./notifyManager.cjs");
5
5
  const require_mutation = require("./mutation.cjs");
6
- //#region src/mutationObserver.ts
6
+ // src/mutationObserver.ts
7
7
  /**
8
8
  * Observes a single mutation and derives a `MutationObserverResult` from it.
9
9
  * A framework hook like `useMutation` creates one `MutationObserver` per hook
@@ -194,7 +194,6 @@ var MutationObserver = class extends require_subscribable.Subscribable {
194
194
  });
195
195
  }
196
196
  };
197
- //#endregion
198
197
  exports.MutationObserver = MutationObserver;
199
198
 
200
199
  //# sourceMappingURL=mutationObserver.cjs.map
@@ -1,2 +1,2 @@
1
- import { qn as MutationObserver } from "./hydration-DhAJ02bL.cjs";
1
+ import { Yn as MutationObserver } from "./hydration-BXjqUj_D.cjs";
2
2
  export { MutationObserver };
@@ -1,2 +1,2 @@
1
- import { qn as MutationObserver } from "./hydration-CS3HS-a9.js";
1
+ import { Yn as MutationObserver } from "./hydration-vgIjIhk6.js";
2
2
  export { MutationObserver };
@@ -2,7 +2,7 @@ import { hashKey, shallowEqualObjects } from "./utils.js";
2
2
  import { Subscribable } from "./subscribable.js";
3
3
  import { notifyManager } from "./notifyManager.js";
4
4
  import { getDefaultState } from "./mutation.js";
5
- //#region src/mutationObserver.ts
5
+ // src/mutationObserver.ts
6
6
  /**
7
7
  * Observes a single mutation and derives a `MutationObserverResult` from it.
8
8
  * A framework hook like `useMutation` creates one `MutationObserver` per hook
@@ -193,7 +193,6 @@ var MutationObserver = class extends Subscribable {
193
193
  });
194
194
  }
195
195
  };
196
- //#endregion
197
196
  export { MutationObserver };
198
197
 
199
198
  //# sourceMappingURL=mutationObserver.js.map
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/notifyManager.ts
2
+ // src/notifyManager.ts
3
3
  /**
4
4
  * Default scheduling function used by the notify manager.
5
5
  * Schedules the callback with the system's `setTimeout(callback, 0)`.
@@ -125,7 +125,6 @@ function createNotifyManager() {
125
125
  * Handles scheduling and batching callbacks in TanStack Query.
126
126
  */
127
127
  const notifyManager = createNotifyManager();
128
- //#endregion
129
128
  exports.createNotifyManager = createNotifyManager;
130
129
  exports.defaultScheduler = defaultScheduler;
131
130
  exports.notifyManager = notifyManager;
@@ -1 +1 @@
1
- {"version":3,"file":"notifyManager.cjs","names":["systemSetTimeoutZero"],"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\nimport { systemSetTimeoutZero } from './timeoutManager'\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\n/**\n * Default scheduling function used by the notify manager.\n * Schedules the callback with the system's `setTimeout(callback, 0)`.\n */\nexport const defaultScheduler: ScheduleFunction = systemSetTimeoutZero\n\n/**\n * Creates a notify manager, which schedules and batches notifications to subscribers. Query uses a\n * single instance of it, exported as {@link notifyManager}.\n * @returns A new notify manager.\n */\nexport function createNotifyManager() {\n let queue: Array<NotifyCallback> = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n /**\n * Batches all updates scheduled inside the passed callback.\n * This is mainly used internally to optimize query client updating.\n * Batches can be nested; the queue is only flushed once the outermost `batch` call finishes.\n * The return value of `callback` is passed through.\n * @param callback - The function to run in the batch.\n * @returns The return value of `callback`.\n */\n batch: <T>(callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n * @param callback - The function to wrap.\n * @returns A function that schedules a call to `callback` with the given arguments.\n */\n batchCalls: <T extends Array<unknown>>(\n callback: BatchCallsCallback<T>,\n ): BatchCallsCallback<T> => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n /**\n * Schedules a function to be run on the next batch.\n * By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`.\n */\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n * @param fn - Receives each notification callback and must call it.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * Framework adapters use this to plug in their own batching primitive, so that a single query\n * update only triggers one re-render instead of one per subscriber.\n * @param fn - Receives a function that runs a batch of notifications and must call it.\n * @example\n * ```ts\n * import { notifyManager } from '@tanstack/query-core'\n * import { batch } from 'solid-js'\n *\n * notifyManager.setBatchNotifyFunction(batch)\n * ```\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n /**\n * Configures a custom callback that schedules when the next batch runs.\n * The default behavior is `setTimeout(callback, 0)`.\n * @param fn - Receives a callback that runs the next batch, and schedules it.\n * @example\n * ```ts\n * import { notifyManager } from '@tanstack/query-core'\n *\n * // Schedule batches in the next microtask\n * notifyManager.setScheduler(queueMicrotask)\n *\n * // Schedule batches before the next frame is rendered\n * notifyManager.setScheduler(requestAnimationFrame)\n *\n * // Schedule batches some time in the future\n * notifyManager.setScheduler((cb) => setTimeout(cb, 10))\n * ```\n */\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\n\n/**\n * Handles scheduling and batching callbacks in TanStack Query.\n */\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;;;;AAkBA,MAAa,iDAAqCA,CAAAA,CAAAA;;;;;;AAOlD,SAAgB,sBAAsB;CACpC,IAAI,QAA+B,CAAC;CACpC,IAAI,eAAe;CACnB,IAAI,YAA4B,aAAa;EAC3C,SAAS;CACX;CACA,IAAI,iBAAsC,aAAyB;EACjE,SAAS;CACX;CACA,IAAI,aAAa;CAEjB,MAAM,YAAY,aAAmC;EACnD,IAAI,cACF,MAAM,KAAK,QAAQ;OAEnB,iBAAiB;GACf,SAAS,QAAQ;EACnB,CAAC;CAEL;CACA,MAAM,cAAoB;EACxB,MAAM,gBAAgB;EACtB,QAAQ,CAAC;EACT,IAAI,cAAc,QAChB,iBAAiB;GACf,oBAAoB;IAClB,cAAc,SAAS,aAAa;KAClC,SAAS,QAAQ;IACnB,CAAC;GACH,CAAC;EACH,CAAC;CAEL;CAEA,OAAO;;;;;;;;;EASL,QAAW,aAAyB;GAClC,IAAI;GACJ;GACA,IAAI;IACF,SAAS,SAAS;GACpB,UAAU;IACR;IACA,IAAI,CAAC,cACH,MAAM;GAEV;GACA,OAAO;EACT;;;;;;EAMA,aACE,aAC0B;GAC1B,QAAQ,GAAG,SAAS;IAClB,eAAe;KACb,SAAS,GAAG,IAAI;IAClB,CAAC;GACH;EACF;;;;;EAKA;;;;;;EAMA,oBAAoB,OAAuB;GACzC,WAAW;EACb;;;;;;;;;;;;;;EAcA,yBAAyB,OAA4B;GACnD,gBAAgB;EAClB;;;;;;;;;;;;;;;;;;;EAmBA,eAAe,OAAyB;GACtC,aAAa;EACf;CACF;AACF;;;;AAOA,MAAa,gBAAgB,oBAAoB"}
1
+ {"version":3,"file":"notifyManager.cjs","names":["systemSetTimeoutZero"],"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\nimport { systemSetTimeoutZero } from './timeoutManager'\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\n/**\n * Default scheduling function used by the notify manager.\n * Schedules the callback with the system's `setTimeout(callback, 0)`.\n */\nexport const defaultScheduler: ScheduleFunction = systemSetTimeoutZero\n\n/**\n * Creates a notify manager, which schedules and batches notifications to subscribers. Query uses a\n * single instance of it, exported as {@link notifyManager}.\n * @returns A new notify manager.\n */\nexport function createNotifyManager() {\n let queue: Array<NotifyCallback> = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n /**\n * Batches all updates scheduled inside the passed callback.\n * This is mainly used internally to optimize query client updating.\n * Batches can be nested; the queue is only flushed once the outermost `batch` call finishes.\n * The return value of `callback` is passed through.\n * @param callback - The function to run in the batch.\n * @returns The return value of `callback`.\n */\n batch: <T>(callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n * @param callback - The function to wrap.\n * @returns A function that schedules a call to `callback` with the given arguments.\n */\n batchCalls: <T extends Array<unknown>>(\n callback: BatchCallsCallback<T>,\n ): BatchCallsCallback<T> => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n /**\n * Schedules a function to be run on the next batch.\n * By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`.\n */\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n * @param fn - Receives each notification callback and must call it.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * Framework adapters use this to plug in their own batching primitive, so that a single query\n * update only triggers one re-render instead of one per subscriber.\n * @param fn - Receives a function that runs a batch of notifications and must call it.\n * @example\n * ```ts\n * import { notifyManager } from '@tanstack/query-core'\n * import { batch } from 'solid-js'\n *\n * notifyManager.setBatchNotifyFunction(batch)\n * ```\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n /**\n * Configures a custom callback that schedules when the next batch runs.\n * The default behavior is `setTimeout(callback, 0)`.\n * @param fn - Receives a callback that runs the next batch, and schedules it.\n * @example\n * ```ts\n * import { notifyManager } from '@tanstack/query-core'\n *\n * // Schedule batches in the next microtask\n * notifyManager.setScheduler(queueMicrotask)\n *\n * // Schedule batches before the next frame is rendered\n * notifyManager.setScheduler(requestAnimationFrame)\n *\n * // Schedule batches some time in the future\n * notifyManager.setScheduler((cb) => setTimeout(cb, 10))\n * ```\n */\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\n\n/**\n * Handles scheduling and batching callbacks in TanStack Query.\n */\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;;;;AAkBA,MAAa,mB,8BAAqCA,CAAAA,CAAAA;;;;;;AAOlD,SAAgB,sBAAsB;CACpC,IAAI,QAA+B,CAAC;CACpC,IAAI,eAAe;CACnB,IAAI,YAA4B,aAAa;EAC3C,SAAS;CACX;CACA,IAAI,iBAAsC,aAAyB;EACjE,SAAS;CACX;CACA,IAAI,aAAa;CAEjB,MAAM,YAAY,aAAmC;EACnD,IAAI,cACF,MAAM,KAAK,QAAQ;OAEnB,iBAAiB;GACf,SAAS,QAAQ;EACnB,CAAC;CAEL;CACA,MAAM,cAAoB;EACxB,MAAM,gBAAgB;EACtB,QAAQ,CAAC;EACT,IAAI,cAAc,QAChB,iBAAiB;GACf,oBAAoB;IAClB,cAAc,SAAS,aAAa;KAClC,SAAS,QAAQ;IACnB,CAAC;GACH,CAAC;EACH,CAAC;CAEL;CAEA,OAAO;;;;;;;;;EASL,QAAW,aAAyB;GAClC,IAAI;GACJ;GACA,IAAI;IACF,SAAS,SAAS;GACpB,UAAU;IACR;IACA,IAAI,CAAC,cACH,MAAM;GAEV;GACA,OAAO;EACT;;;;;;EAMA,aACE,aAC0B;GAC1B,QAAQ,GAAG,SAAS;IAClB,eAAe;KACb,SAAS,GAAG,IAAI;IAClB,CAAC;GACH;EACF;;;;;EAKA;;;;;;EAMA,oBAAoB,OAAuB;GACzC,WAAW;EACb;;;;;;;;;;;;;;EAcA,yBAAyB,OAA4B;GACnD,gBAAgB;EAClB;;;;;;;;;;;;;;;;;;;EAmBA,eAAe,OAAyB;GACtC,aAAa;EACf;CACF;AACF;;;;AAOA,MAAa,gBAAgB,oBAAoB"}
@@ -1,4 +1,3 @@
1
- //#region src/notifyManager.d.ts
2
1
  type NotifyCallback = () => void;
3
2
  type NotifyFunction = (callback: () => void) => void;
4
3
  type BatchNotifyFunction = (callback: () => void) => void;
@@ -139,5 +138,4 @@ export declare const notifyManager: {
139
138
  */
140
139
  readonly setScheduler: (fn: ScheduleFunction) => void;
141
140
  };
142
- //#endregion
143
141
  //# sourceMappingURL=notifyManager.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifyManager.d.cts","names":[],"sources":["../../src/notifyManager.ts"],"mappings":";KAIK;KAEA,kBAAkB;KAElB,uBAAuB;KAEvB,mBAAmB,UAAU,sBAAsB,MAAM;KAEzD,oBAAoB;;;;;qBAMZ,kBAAkB;;;;;;wBAOf;;;;;;;;;WA2CJ,QAAA,GAAC,gBAAkB,MAAI;;;;;;WAkBlB,aAAA,UAAU,gBAAc,UACzB,mBAAmB,OAC5B,mBAAmB;;;;;WApDI,WAAA,UAAA;;;;;;WAqEF,oBAAA,IAAA;;;;;;;;;;;;;;WAgBK,yBAAA,IAAA;;;;;;;;;;;;;;;;;;;WAqBV,eAAA,IAAA;;;;;qBAWV;;;;;;;;;WArFD,QAAA,GAAC,gBAAkB,MAAI;;;;;;WAkBlB,aAAA,UAAU,gBAAc,UACzB,mBAAmB,OAC5B,mBAAmB;;;;;WApDI,WAAA,UAAA;;;;;;WAqEF,oBAAA,IAAA;;;;;;;;;;;;;;WAgBK,yBAAA,IAAA;;;;;;;;;;;;;;;;;;;WAqBV,eAAA,IAAA"}
1
+ {"version":3,"file":"notifyManager.d.cts","names":[],"sources":["../../src/notifyManager.ts"],"mappings":"A,KAIK;KAEA,kBAAkB;KAElB,uBAAuB;KAEvB,mBAAmB,UAAU,sBAAsB,MAAM;KAEzD,oBAAoB;;;;;qBAMZ,kBAAkB;;;;;;wBAOf;;;;;;;;;WA2CJ,QAAA,GAAC,gBAAkB,MAAI;;;;;;WAkBlB,aAAA,UAAU,gBAAc,UACzB,mBAAmB,OAC5B,mBAAmB;;;;;WApDI,WAAA,UAAA;;;;;;WAqEF,oBAAA,IAAA;;;;;;;;;;;;;;WAgBK,yBAAA,IAAA;;;;;;;;;;;;;;;;;;;WAqBV,eAAA,IAAA;;;;;qBAWV;;;;;;;;;WArFD,QAAA,GAAC,gBAAkB,MAAI;;;;;;WAkBlB,aAAA,UAAU,gBAAc,UACzB,mBAAmB,OAC5B,mBAAmB;;;;;WApDI,WAAA,UAAA;;;;;;WAqEF,oBAAA,IAAA;;;;;;;;;;;;;;WAgBK,yBAAA,IAAA;;;;;;;;;;;;;;;;;;;WAqBV,eAAA,IAAA"}
@@ -1,4 +1,3 @@
1
- //#region src/notifyManager.d.ts
2
1
  type NotifyCallback = () => void;
3
2
  type NotifyFunction = (callback: () => void) => void;
4
3
  type BatchNotifyFunction = (callback: () => void) => void;
@@ -139,5 +138,4 @@ export declare const notifyManager: {
139
138
  */
140
139
  readonly setScheduler: (fn: ScheduleFunction) => void;
141
140
  };
142
- //#endregion
143
141
  //# sourceMappingURL=notifyManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifyManager.d.ts","names":[],"sources":["../../src/notifyManager.ts"],"mappings":";KAIK;KAEA,kBAAkB;KAElB,uBAAuB;KAEvB,mBAAmB,UAAU,sBAAsB,MAAM;KAEzD,oBAAoB;;;;;qBAMZ,kBAAkB;;;;;;wBAOf;;;;;;;;;WA2CJ,QAAA,GAAC,gBAAkB,MAAI;;;;;;WAkBlB,aAAA,UAAU,gBAAc,UACzB,mBAAmB,OAC5B,mBAAmB;;;;;WApDI,WAAA,UAAA;;;;;;WAqEF,oBAAA,IAAA;;;;;;;;;;;;;;WAgBK,yBAAA,IAAA;;;;;;;;;;;;;;;;;;;WAqBV,eAAA,IAAA;;;;;qBAWV;;;;;;;;;WArFD,QAAA,GAAC,gBAAkB,MAAI;;;;;;WAkBlB,aAAA,UAAU,gBAAc,UACzB,mBAAmB,OAC5B,mBAAmB;;;;;WApDI,WAAA,UAAA;;;;;;WAqEF,oBAAA,IAAA;;;;;;;;;;;;;;WAgBK,yBAAA,IAAA;;;;;;;;;;;;;;;;;;;WAqBV,eAAA,IAAA"}
1
+ {"version":3,"file":"notifyManager.d.ts","names":[],"sources":["../../src/notifyManager.ts"],"mappings":"A,KAIK;KAEA,kBAAkB;KAElB,uBAAuB;KAEvB,mBAAmB,UAAU,sBAAsB,MAAM;KAEzD,oBAAoB;;;;;qBAMZ,kBAAkB;;;;;;wBAOf;;;;;;;;;WA2CJ,QAAA,GAAC,gBAAkB,MAAI;;;;;;WAkBlB,aAAA,UAAU,gBAAc,UACzB,mBAAmB,OAC5B,mBAAmB;;;;;WApDI,WAAA,UAAA;;;;;;WAqEF,oBAAA,IAAA;;;;;;;;;;;;;;WAgBK,yBAAA,IAAA;;;;;;;;;;;;;;;;;;;WAqBV,eAAA,IAAA;;;;;qBAWV;;;;;;;;;WArFD,QAAA,GAAC,gBAAkB,MAAI;;;;;;WAkBlB,aAAA,UAAU,gBAAc,UACzB,mBAAmB,OAC5B,mBAAmB;;;;;WApDI,WAAA,UAAA;;;;;;WAqEF,oBAAA,IAAA;;;;;;;;;;;;;;WAgBK,yBAAA,IAAA;;;;;;;;;;;;;;;;;;;WAqBV,eAAA,IAAA"}
@@ -1,5 +1,5 @@
1
1
  import { systemSetTimeoutZero } from "./timeoutManager.js";
2
- //#region src/notifyManager.ts
2
+ // src/notifyManager.ts
3
3
  /**
4
4
  * Default scheduling function used by the notify manager.
5
5
  * Schedules the callback with the system's `setTimeout(callback, 0)`.
@@ -125,7 +125,6 @@ function createNotifyManager() {
125
125
  * Handles scheduling and batching callbacks in TanStack Query.
126
126
  */
127
127
  const notifyManager = createNotifyManager();
128
- //#endregion
129
128
  export { createNotifyManager, defaultScheduler, notifyManager };
130
129
 
131
130
  //# sourceMappingURL=notifyManager.js.map
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_subscribable = require("./subscribable.cjs");
3
- //#region src/onlineManager.ts
3
+ // src/onlineManager.ts
4
4
  /**
5
5
  * The `OnlineManager` manages the online state within TanStack Query. It can
6
6
  * be used to change the default event listeners or to manually change the
@@ -96,7 +96,6 @@ var OnlineManager = class extends require_subscribable.Subscribable {
96
96
  * Singleton instance of {@link OnlineManager}, used to manage and observe the online state within TanStack Query.
97
97
  */
98
98
  const onlineManager = new OnlineManager();
99
- //#endregion
100
99
  exports.OnlineManager = OnlineManager;
101
100
  exports.onlineManager = onlineManager;
102
101
 
@@ -1,5 +1,4 @@
1
- import { t as Subscribable } from "./subscribable-czlHOxMP.cjs";
2
- //#region src/onlineManager.d.ts
1
+ import { t as Subscribable } from "./subscribable-D2lAzdDi.cjs";
3
2
  type Listener = (online: boolean) => void;
4
3
  type SetupFn = (setOnline: Listener) => (() => void) | undefined;
5
4
  /**
@@ -61,5 +60,4 @@ export declare class OnlineManager extends Subscribable<Listener> {
61
60
  * Singleton instance of {@link OnlineManager}, used to manage and observe the online state within TanStack Query.
62
61
  */
63
62
  export declare const onlineManager: OnlineManager;
64
- //#endregion
65
63
  //# sourceMappingURL=onlineManager.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"onlineManager.d.cts","names":[],"sources":["../../src/onlineManager.ts"],"mappings":";;KAEK,YAAY;KACZ,WAAW,WAAW;;;;;;;;;;qBAWd,sBAAsB,aAAa;;;YA6B3B;YAMA;;;;;;;;;;;;;;;;;;;;EA0BnB,iBAAiB,OAAO;;;;;;;;;;;;;;;EAoBxB,UAAU;;;;;EAeV;;;;;qBAQW,eAAa"}
1
+ {"version":3,"file":"onlineManager.d.cts","names":[],"sources":["../../src/onlineManager.ts"],"mappings":";KAEK,YAAY;KACZ,WAAW,WAAW;;;;;;;;;;qBAWd,sBAAsB,aAAa;;;YA6B3B;YAMA;;;;;;;;;;;;;;;;;;;;EA0BnB,iBAAiB,OAAO;;;;;;;;;;;;;;;EAoBxB,UAAU;;;;;EAeV;;;;;qBAQW,eAAa"}
@@ -1,5 +1,4 @@
1
- import { t as Subscribable } from "./subscribable-czlHOxMP.js";
2
- //#region src/onlineManager.d.ts
1
+ import { t as Subscribable } from "./subscribable-D2lAzdDi.js";
3
2
  type Listener = (online: boolean) => void;
4
3
  type SetupFn = (setOnline: Listener) => (() => void) | undefined;
5
4
  /**
@@ -61,5 +60,4 @@ export declare class OnlineManager extends Subscribable<Listener> {
61
60
  * Singleton instance of {@link OnlineManager}, used to manage and observe the online state within TanStack Query.
62
61
  */
63
62
  export declare const onlineManager: OnlineManager;
64
- //#endregion
65
63
  //# sourceMappingURL=onlineManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"onlineManager.d.ts","names":[],"sources":["../../src/onlineManager.ts"],"mappings":";;KAEK,YAAY;KACZ,WAAW,WAAW;;;;;;;;;;qBAWd,sBAAsB,aAAa;;;YA6B3B;YAMA;;;;;;;;;;;;;;;;;;;;EA0BnB,iBAAiB,OAAO;;;;;;;;;;;;;;;EAoBxB,UAAU;;;;;EAeV;;;;;qBAQW,eAAa"}
1
+ {"version":3,"file":"onlineManager.d.ts","names":[],"sources":["../../src/onlineManager.ts"],"mappings":";KAEK,YAAY;KACZ,WAAW,WAAW;;;;;;;;;;qBAWd,sBAAsB,aAAa;;;YA6B3B;YAMA;;;;;;;;;;;;;;;;;;;;EA0BnB,iBAAiB,OAAO;;;;;;;;;;;;;;;EAoBxB,UAAU;;;;;EAeV;;;;;qBAQW,eAAa"}
@@ -1,5 +1,5 @@
1
1
  import { Subscribable } from "./subscribable.js";
2
- //#region src/onlineManager.ts
2
+ // src/onlineManager.ts
3
3
  /**
4
4
  * The `OnlineManager` manages the online state within TanStack Query. It can
5
5
  * be used to change the default event listeners or to manually change the
@@ -95,7 +95,6 @@ var OnlineManager = class extends Subscribable {
95
95
  * Singleton instance of {@link OnlineManager}, used to manage and observe the online state within TanStack Query.
96
96
  */
97
97
  const onlineManager = new OnlineManager();
98
- //#endregion
99
98
  export { OnlineManager, onlineManager };
100
99
 
101
100
  //# sourceMappingURL=onlineManager.js.map
@@ -3,7 +3,7 @@ const require_utils = require("./utils.cjs");
3
3
  const require_subscribable = require("./subscribable.cjs");
4
4
  const require_notifyManager = require("./notifyManager.cjs");
5
5
  const require_queryObserver = require("./queryObserver.cjs");
6
- //#region src/queriesObserver.ts
6
+ // src/queriesObserver.ts
7
7
  /**
8
8
  * Returns the items of `array1` that are not in `array2`.
9
9
  * @param array1 - The items to filter.
@@ -257,7 +257,6 @@ var QueriesObserver = class extends require_subscribable.Subscribable {
257
257
  }
258
258
  }
259
259
  };
260
- //#endregion
261
260
  exports.QueriesObserver = QueriesObserver;
262
261
 
263
262
  //# sourceMappingURL=queriesObserver.cjs.map
@@ -1,6 +1,5 @@
1
- import { t as Subscribable } from "./subscribable-czlHOxMP.cjs";
2
- import { $n as Query, At as QueryObserverOptions, Pt as QueryObserverResult, on as QueryClient, rr as QueryObserver } from "./hydration-DhAJ02bL.cjs";
3
- //#region src/queriesObserver.d.ts
1
+ import { t as Subscribable } from "./subscribable-D2lAzdDi.cjs";
2
+ import { At as QueryObserverOptions, Pt as QueryObserverResult, ar as QueryObserver, on as QueryClient, tr as Query } from "./hydration-BXjqUj_D.cjs";
4
3
  type QueriesObserverListener = (result: Array<QueryObserverResult>) => void;
5
4
  type CombineFn<TCombinedResult> = (result: Array<QueryObserverResult>) => TCombinedResult;
6
5
  /**
@@ -99,5 +98,4 @@ export declare class QueriesObserver<TCombinedResult = Array<QueryObserverResult
99
98
  */
100
99
  getOptimisticResult(queries: Array<QueryObserverOptions>, combine: CombineFn<TCombinedResult> | undefined): [rawResult: Array<QueryObserverResult>, combineResult: (r?: Array<QueryObserverResult>) => TCombinedResult, trackResult: () => Array<QueryObserverResult>];
101
100
  }
102
- //#endregion
103
101
  //# sourceMappingURL=queriesObserver.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queriesObserver.d.cts","names":["_$__query0.Query"],"sources":["../../src/queriesObserver.ts"],"mappings":";;;KAsBK,2BAA2B,QAAQ,MAAM;KAEzC,UAAU,oBACb,QAAQ,MAAM,yBACX;;;;iBAKY,uBACf,kBAAkB,MAAM;;;;;;;;;EAUxB,UAAU,UAAU;;;;;;;;;;;;;;;;;;;;qBAqBT,gBACX,kBAAkB,MAAM,8BAChB,aAAa;;EAanB,YAAA,QAAQ,aACR,SAAS,MAAM,gDACf,UAAU,uBAAuB;YAahB;YAUA;;;;;EAUnB;;;;;;;;;;;;;;;;EAsBA,WACE,SAAS,MAAM,uBACf,UAAU,uBAAuB;;;;;;;;;;;;EAiFnC,oBAAoB,MAAM;;;;;;EAS1B,cAAUA,eAAA;;;;;;;EAUV,gBAAY,uBAAA;;;;;;;;;;;;EAeZ,oBACE,SAAS,MAAM,uBACf,SAAS,UAAU,gCAEnB,WAAW,MAAM,sBACjB,gBAAgB,IAAI,MAAM,yBAAyB,iBACnD,mBAAmB,MAAM"}
1
+ {"version":3,"file":"queriesObserver.d.cts","names":["_$__query0.Query"],"sources":["../../src/queriesObserver.ts"],"mappings":";;KAsBK,2BAA2B,QAAQ,MAAM;KAEzC,UAAU,oBACb,QAAQ,MAAM,yBACX;;;;iBAKY,uBACf,kBAAkB,MAAM;;;;;;;;;EAUxB,UAAU,UAAU;;;;;;;;;;;;;;;;;;;;qBAqBT,gBACX,kBAAkB,MAAM,8BAChB,aAAa;;EAanB,YAAA,QAAQ,aACR,SAAS,MAAM,gDACf,UAAU,uBAAuB;YAahB;YAUA;;;;;EAUnB;;;;;;;;;;;;;;;;EAsBA,WACE,SAAS,MAAM,uBACf,UAAU,uBAAuB;;;;;;;;;;;;EAiFnC,oBAAoB,MAAM;;;;;;EAS1B,cAAUA,eAAA;;;;;;;EAUV,gBAAY,uBAAA;;;;;;;;;;;;EAeZ,oBACE,SAAS,MAAM,uBACf,SAAS,UAAU,gCAEnB,WAAW,MAAM,sBACjB,gBAAgB,IAAI,MAAM,yBAAyB,iBACnD,mBAAmB,MAAM"}
@@ -1,6 +1,5 @@
1
- import { t as Subscribable } from "./subscribable-czlHOxMP.js";
2
- import { $n as Query, At as QueryObserverOptions, Pt as QueryObserverResult, on as QueryClient, rr as QueryObserver } from "./hydration-CS3HS-a9.js";
3
- //#region src/queriesObserver.d.ts
1
+ import { t as Subscribable } from "./subscribable-D2lAzdDi.js";
2
+ import { At as QueryObserverOptions, Pt as QueryObserverResult, ar as QueryObserver, on as QueryClient, tr as Query } from "./hydration-vgIjIhk6.js";
4
3
  type QueriesObserverListener = (result: Array<QueryObserverResult>) => void;
5
4
  type CombineFn<TCombinedResult> = (result: Array<QueryObserverResult>) => TCombinedResult;
6
5
  /**
@@ -99,5 +98,4 @@ export declare class QueriesObserver<TCombinedResult = Array<QueryObserverResult
99
98
  */
100
99
  getOptimisticResult(queries: Array<QueryObserverOptions>, combine: CombineFn<TCombinedResult> | undefined): [rawResult: Array<QueryObserverResult>, combineResult: (r?: Array<QueryObserverResult>) => TCombinedResult, trackResult: () => Array<QueryObserverResult>];
101
100
  }
102
- //#endregion
103
101
  //# sourceMappingURL=queriesObserver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queriesObserver.d.ts","names":["_$__query0.Query"],"sources":["../../src/queriesObserver.ts"],"mappings":";;;KAsBK,2BAA2B,QAAQ,MAAM;KAEzC,UAAU,oBACb,QAAQ,MAAM,yBACX;;;;iBAKY,uBACf,kBAAkB,MAAM;;;;;;;;;EAUxB,UAAU,UAAU;;;;;;;;;;;;;;;;;;;;qBAqBT,gBACX,kBAAkB,MAAM,8BAChB,aAAa;;EAanB,YAAA,QAAQ,aACR,SAAS,MAAM,gDACf,UAAU,uBAAuB;YAahB;YAUA;;;;;EAUnB;;;;;;;;;;;;;;;;EAsBA,WACE,SAAS,MAAM,uBACf,UAAU,uBAAuB;;;;;;;;;;;;EAiFnC,oBAAoB,MAAM;;;;;;EAS1B,cAAUA,eAAA;;;;;;;EAUV,gBAAY,uBAAA;;;;;;;;;;;;EAeZ,oBACE,SAAS,MAAM,uBACf,SAAS,UAAU,gCAEnB,WAAW,MAAM,sBACjB,gBAAgB,IAAI,MAAM,yBAAyB,iBACnD,mBAAmB,MAAM"}
1
+ {"version":3,"file":"queriesObserver.d.ts","names":["_$__query0.Query"],"sources":["../../src/queriesObserver.ts"],"mappings":";;KAsBK,2BAA2B,QAAQ,MAAM;KAEzC,UAAU,oBACb,QAAQ,MAAM,yBACX;;;;iBAKY,uBACf,kBAAkB,MAAM;;;;;;;;;EAUxB,UAAU,UAAU;;;;;;;;;;;;;;;;;;;;qBAqBT,gBACX,kBAAkB,MAAM,8BAChB,aAAa;;EAanB,YAAA,QAAQ,aACR,SAAS,MAAM,gDACf,UAAU,uBAAuB;YAahB;YAUA;;;;;EAUnB;;;;;;;;;;;;;;;;EAsBA,WACE,SAAS,MAAM,uBACf,UAAU,uBAAuB;;;;;;;;;;;;EAiFnC,oBAAoB,MAAM;;;;;;EAS1B,cAAUA,eAAA;;;;;;;EAUV,gBAAY,uBAAA;;;;;;;;;;;;EAeZ,oBACE,SAAS,MAAM,uBACf,SAAS,UAAU,gCAEnB,WAAW,MAAM,sBACjB,gBAAgB,IAAI,MAAM,yBAAyB,iBACnD,mBAAmB,MAAM"}
@@ -2,7 +2,7 @@ import { replaceEqualDeep, shallowEqualObjects } from "./utils.js";
2
2
  import { Subscribable } from "./subscribable.js";
3
3
  import { notifyManager } from "./notifyManager.js";
4
4
  import { QueryObserver } from "./queryObserver.js";
5
- //#region src/queriesObserver.ts
5
+ // src/queriesObserver.ts
6
6
  /**
7
7
  * Returns the items of `array1` that are not in `array2`.
8
8
  * @param array1 - The items to filter.
@@ -256,7 +256,6 @@ var QueriesObserver = class extends Subscribable {
256
256
  }
257
257
  }
258
258
  };
259
- //#endregion
260
259
  export { QueriesObserver };
261
260
 
262
261
  //# sourceMappingURL=queriesObserver.js.map
@@ -4,7 +4,7 @@ const require_notifyManager = require("./notifyManager.cjs");
4
4
  const require_retryer = require("./retryer.cjs");
5
5
  const require_removable = require("./removable.cjs");
6
6
  const require_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs");
7
- //#region src/query.ts
7
+ // src/query.ts
8
8
  /**
9
9
  * Represents a single cached query. A `Query` holds the query's key, options,
10
10
  * state (data/error/status), and the observers currently subscribed to it.
@@ -30,6 +30,7 @@ var Query = class extends require_removable.Removable {
30
30
  #cache;
31
31
  #client;
32
32
  #retryer;
33
+ #fetchPromise;
33
34
  #defaultOptions;
34
35
  #abortSignalConsumed;
35
36
  constructor(config) {
@@ -352,9 +353,9 @@ var Query = class extends require_removable.Removable {
352
353
  async fetch(options, fetchOptions) {
353
354
  if (this.state.fetchStatus !== "idle" && this.#retryer?.status() !== "rejected") {
354
355
  if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) this.cancel({ silent: true });
355
- else if (this.#retryer) {
356
+ else if (this.#retryer && this.#fetchPromise) {
356
357
  this.#retryer.continueRetry();
357
- return this.#retryer.promise;
358
+ return this.#fetchPromise;
358
359
  }
359
360
  }
360
361
  if (options) this.setOptions(options);
@@ -367,11 +368,17 @@ var Query = class extends require_removable.Removable {
367
368
  }
368
369
  const abortController = new AbortController();
369
370
  const addSignalProperty = (object) => {
370
- Object.defineProperty(object, "signal", {
371
- enumerable: true,
372
- get: () => {
373
- this.#abortSignalConsumed = true;
374
- return abortController.signal;
371
+ Object.defineProperties(object, {
372
+ [require_utils.fetchSignal]: {
373
+ value: abortController.signal,
374
+ enumerable: true
375
+ },
376
+ signal: {
377
+ enumerable: true,
378
+ get: () => {
379
+ this.#abortSignalConsumed = true;
380
+ return abortController.signal;
381
+ }
375
382
  }
376
383
  });
377
384
  };
@@ -438,35 +445,45 @@ var Query = class extends require_removable.Removable {
438
445
  networkMode: context.options.networkMode,
439
446
  canRun: () => true
440
447
  });
441
- try {
442
- const data = await retryer.start();
443
- if (data === void 0) {
444
- if (process.env.NODE_ENV !== "production") console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`);
445
- throw new Error(`${this.queryHash} data is undefined`);
446
- }
447
- this.setData(data);
448
- this.#cache.config.onSuccess?.(data, this);
449
- this.#cache.config.onSettled?.(data, this.state.error, this);
450
- return data;
451
- } catch (error) {
452
- if (error instanceof require_retryer.CancelledError) {
453
- if (error.silent) return this.#retryer.promise;
454
- else if (error.revert) {
455
- if (this.state.data === void 0) throw error;
456
- return this.state.data;
448
+ const fetchPromise = (async () => {
449
+ try {
450
+ const data = await retryer.promise;
451
+ if (data === void 0) {
452
+ if (process.env.NODE_ENV !== "production") console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`);
453
+ throw new Error(`${this.queryHash} data is undefined`);
454
+ }
455
+ this.setData(data);
456
+ this.#cache.config.onSuccess?.(data, this);
457
+ this.#cache.config.onSettled?.(data, this.state.error, this);
458
+ return data;
459
+ } catch (error) {
460
+ if (error instanceof require_retryer.CancelledError) {
461
+ if (error.silent) {
462
+ if (this.#retryer !== retryer && this.#fetchPromise) return this.#fetchPromise;
463
+ throw error;
464
+ } else if (error.revert) {
465
+ if (this.state.data === void 0) throw error;
466
+ return this.state.data;
467
+ }
457
468
  }
469
+ this.#dispatch({
470
+ type: "error",
471
+ error
472
+ });
473
+ this.#cache.config.onError?.(error, this);
474
+ this.#cache.config.onSettled?.(this.state.data, error, this);
475
+ throw error;
476
+ } finally {
477
+ if (this.#retryer === retryer) {
478
+ this.#retryer = void 0;
479
+ this.#fetchPromise = void 0;
480
+ }
481
+ this.scheduleGc();
458
482
  }
459
- this.#dispatch({
460
- type: "error",
461
- error
462
- });
463
- this.#cache.config.onError?.(error, this);
464
- this.#cache.config.onSettled?.(this.state.data, error, this);
465
- throw error;
466
- } finally {
467
- if (this.#retryer === retryer) this.#retryer = void 0;
468
- this.scheduleGc();
469
- }
483
+ })();
484
+ this.#fetchPromise = fetchPromise;
485
+ retryer.start();
486
+ return fetchPromise;
470
487
  }
471
488
  #dispatch(action) {
472
489
  const reducer = (state) => {
@@ -597,7 +614,6 @@ function getDefaultState(options) {
597
614
  fetchStatus: "idle"
598
615
  };
599
616
  }
600
- //#endregion
601
617
  exports.Query = Query;
602
618
  exports.fetchState = fetchState;
603
619