@tanstack/query-core 5.0.0-alpha.86 → 5.0.0-alpha.87

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 (441) hide show
  1. package/build/legacy/focusManager.cjs +116 -0
  2. package/build/legacy/focusManager.cjs.map +1 -0
  3. package/build/legacy/focusManager.d.cts +16 -0
  4. package/build/{lib → legacy}/focusManager.d.ts +6 -5
  5. package/build/legacy/focusManager.js +91 -0
  6. package/build/legacy/focusManager.js.map +1 -0
  7. package/build/legacy/hydration.cjs +109 -0
  8. package/build/legacy/hydration.cjs.map +1 -0
  9. package/build/legacy/hydration.d.cts +35 -0
  10. package/build/legacy/hydration.d.ts +35 -0
  11. package/build/legacy/hydration.js +82 -0
  12. package/build/legacy/hydration.js.map +1 -0
  13. package/build/legacy/index.cjs +85 -0
  14. package/build/legacy/index.cjs.map +1 -0
  15. package/build/legacy/index.d.cts +9 -0
  16. package/build/legacy/index.d.ts +9 -0
  17. package/build/legacy/index.js +50 -0
  18. package/build/legacy/index.js.map +1 -0
  19. package/build/legacy/infiniteQueryBehavior.cjs +141 -0
  20. package/build/legacy/infiniteQueryBehavior.cjs.map +1 -0
  21. package/build/legacy/infiniteQueryBehavior.d.cts +15 -0
  22. package/build/legacy/infiniteQueryBehavior.d.ts +15 -0
  23. package/build/legacy/infiniteQueryBehavior.js +115 -0
  24. package/build/legacy/infiniteQueryBehavior.js.map +1 -0
  25. package/build/legacy/infiniteQueryObserver.cjs +88 -0
  26. package/build/legacy/infiniteQueryObserver.cjs.map +1 -0
  27. package/build/legacy/infiniteQueryObserver.d.cts +19 -0
  28. package/build/{lib → legacy}/infiniteQueryObserver.d.ts +7 -8
  29. package/build/{lib/infiniteQueryObserver.legacy.js → legacy/infiniteQueryObserver.js} +24 -32
  30. package/build/legacy/infiniteQueryObserver.js.map +1 -0
  31. package/build/legacy/mutation.cjs +297 -0
  32. package/build/legacy/mutation.cjs.map +1 -0
  33. package/build/legacy/mutation.d.cts +3 -0
  34. package/build/legacy/mutation.d.ts +3 -0
  35. package/build/legacy/mutation.js +272 -0
  36. package/build/legacy/mutation.js.map +1 -0
  37. package/build/legacy/mutationCache.cjs +133 -0
  38. package/build/legacy/mutationCache.cjs.map +1 -0
  39. package/build/legacy/mutationCache.d.cts +3 -0
  40. package/build/legacy/mutationCache.d.ts +3 -0
  41. package/build/legacy/mutationCache.js +109 -0
  42. package/build/legacy/mutationCache.js.map +1 -0
  43. package/build/legacy/mutationObserver.cjs +171 -0
  44. package/build/legacy/mutationObserver.cjs.map +1 -0
  45. package/build/legacy/mutationObserver.d.cts +3 -0
  46. package/build/legacy/mutationObserver.d.ts +3 -0
  47. package/build/legacy/mutationObserver.js +147 -0
  48. package/build/legacy/mutationObserver.js.map +1 -0
  49. package/build/legacy/notifyManager.cjs +97 -0
  50. package/build/legacy/notifyManager.cjs.map +1 -0
  51. package/build/legacy/notifyManager.d.cts +20 -0
  52. package/build/{lib → legacy}/notifyManager.d.ts +4 -4
  53. package/build/{lib → legacy}/notifyManager.js +14 -31
  54. package/build/legacy/notifyManager.js.map +1 -0
  55. package/build/legacy/onlineManager.cjs +106 -0
  56. package/build/legacy/onlineManager.cjs.map +1 -0
  57. package/build/legacy/onlineManager.d.cts +16 -0
  58. package/build/{lib → legacy}/onlineManager.d.ts +6 -5
  59. package/build/legacy/onlineManager.js +81 -0
  60. package/build/legacy/onlineManager.js.map +1 -0
  61. package/build/legacy/queriesObserver.cjs +242 -0
  62. package/build/legacy/queriesObserver.cjs.map +1 -0
  63. package/build/legacy/queriesObserver.d.cts +26 -0
  64. package/build/{lib → legacy}/queriesObserver.d.ts +10 -11
  65. package/build/legacy/queriesObserver.js +218 -0
  66. package/build/legacy/queriesObserver.js.map +1 -0
  67. package/build/legacy/query.cjs +423 -0
  68. package/build/legacy/query.cjs.map +1 -0
  69. package/build/legacy/query.d.cts +3 -0
  70. package/build/legacy/query.d.ts +3 -0
  71. package/build/legacy/query.js +399 -0
  72. package/build/legacy/query.js.map +1 -0
  73. package/build/legacy/queryCache.cjs +140 -0
  74. package/build/legacy/queryCache.cjs.map +1 -0
  75. package/build/legacy/queryCache.d.cts +3 -0
  76. package/build/legacy/queryCache.d.ts +3 -0
  77. package/build/legacy/queryCache.js +116 -0
  78. package/build/legacy/queryCache.js.map +1 -0
  79. package/build/legacy/queryClient-4ba6364e.d.ts +916 -0
  80. package/build/legacy/queryClient-d615ed9f.d.ts +916 -0
  81. package/build/legacy/queryClient.cjs +322 -0
  82. package/build/legacy/queryClient.cjs.map +1 -0
  83. package/build/legacy/queryClient.d.cts +3 -0
  84. package/build/legacy/queryClient.d.ts +3 -0
  85. package/build/legacy/queryClient.js +304 -0
  86. package/build/legacy/queryClient.js.map +1 -0
  87. package/build/legacy/queryObserver.cjs +501 -0
  88. package/build/legacy/queryObserver.cjs.map +1 -0
  89. package/build/legacy/queryObserver.d.cts +3 -0
  90. package/build/legacy/queryObserver.d.ts +3 -0
  91. package/build/legacy/queryObserver.js +484 -0
  92. package/build/legacy/queryObserver.js.map +1 -0
  93. package/build/legacy/removable.cjs +77 -0
  94. package/build/legacy/removable.cjs.map +1 -0
  95. package/build/legacy/removable.d.cts +11 -0
  96. package/build/{lib → legacy}/removable.d.ts +3 -2
  97. package/build/legacy/removable.js +53 -0
  98. package/build/legacy/removable.js.map +1 -0
  99. package/build/legacy/retryer.cjs +169 -0
  100. package/build/legacy/retryer.cjs.map +1 -0
  101. package/build/legacy/retryer.d.cts +3 -0
  102. package/build/legacy/retryer.d.ts +3 -0
  103. package/build/{lib/retryer.legacy.js → legacy/retryer.js} +37 -48
  104. package/build/legacy/retryer.js.map +1 -0
  105. package/build/legacy/subscribable.cjs +49 -0
  106. package/build/legacy/subscribable.cjs.map +1 -0
  107. package/build/legacy/subscribable.d.cts +11 -0
  108. package/build/{lib → legacy}/subscribable.d.ts +3 -3
  109. package/build/{lib → legacy}/subscribable.js +5 -6
  110. package/build/legacy/subscribable.js.map +1 -0
  111. package/build/legacy/types.cjs +17 -0
  112. package/build/legacy/types.cjs.map +1 -0
  113. package/build/legacy/types.d.cts +3 -0
  114. package/build/legacy/types.d.ts +3 -0
  115. package/build/legacy/types.js +1 -0
  116. package/build/legacy/types.js.map +1 -0
  117. package/build/{lib/utils.legacy.cjs → legacy/utils.cjs} +92 -93
  118. package/build/legacy/utils.cjs.map +1 -0
  119. package/build/legacy/utils.d.cts +3 -0
  120. package/build/legacy/utils.d.ts +3 -0
  121. package/build/{lib/utils.legacy.js → legacy/utils.js} +49 -72
  122. package/build/legacy/utils.js.map +1 -0
  123. package/build/modern/focusManager.cjs +91 -0
  124. package/build/modern/focusManager.cjs.map +1 -0
  125. package/build/modern/focusManager.d.cts +16 -0
  126. package/build/modern/focusManager.d.ts +16 -0
  127. package/build/modern/focusManager.js +66 -0
  128. package/build/modern/focusManager.js.map +1 -0
  129. package/build/modern/hydration.cjs +107 -0
  130. package/build/modern/hydration.cjs.map +1 -0
  131. package/build/modern/hydration.d.cts +35 -0
  132. package/build/modern/hydration.d.ts +35 -0
  133. package/build/modern/hydration.js +80 -0
  134. package/build/modern/hydration.js.map +1 -0
  135. package/build/modern/index.cjs +85 -0
  136. package/build/modern/index.cjs.map +1 -0
  137. package/build/modern/index.d.cts +9 -0
  138. package/build/modern/index.d.ts +9 -0
  139. package/build/modern/index.js +50 -0
  140. package/build/modern/index.js.map +1 -0
  141. package/build/modern/infiniteQueryBehavior.cjs +138 -0
  142. package/build/modern/infiniteQueryBehavior.cjs.map +1 -0
  143. package/build/modern/infiniteQueryBehavior.d.cts +15 -0
  144. package/build/modern/infiniteQueryBehavior.d.ts +15 -0
  145. package/build/{lib → modern}/infiniteQueryBehavior.js +46 -53
  146. package/build/modern/infiniteQueryBehavior.js.map +1 -0
  147. package/build/modern/infiniteQueryObserver.cjs +87 -0
  148. package/build/modern/infiniteQueryObserver.cjs.map +1 -0
  149. package/build/modern/infiniteQueryObserver.d.cts +19 -0
  150. package/build/modern/infiniteQueryObserver.d.ts +19 -0
  151. package/build/{lib → modern}/infiniteQueryObserver.js +23 -31
  152. package/build/modern/infiniteQueryObserver.js.map +1 -0
  153. package/build/modern/mutation.cjs +259 -0
  154. package/build/modern/mutation.cjs.map +1 -0
  155. package/build/modern/mutation.d.cts +3 -0
  156. package/build/modern/mutation.d.ts +3 -0
  157. package/build/{lib → modern}/mutation.js +86 -86
  158. package/build/modern/mutation.js.map +1 -0
  159. package/build/modern/mutationCache.cjs +103 -0
  160. package/build/modern/mutationCache.cjs.map +1 -0
  161. package/build/modern/mutationCache.d.cts +3 -0
  162. package/build/modern/mutationCache.d.ts +3 -0
  163. package/build/modern/mutationCache.js +79 -0
  164. package/build/modern/mutationCache.js.map +1 -0
  165. package/build/modern/mutationObserver.cjs +132 -0
  166. package/build/modern/mutationObserver.cjs.map +1 -0
  167. package/build/modern/mutationObserver.d.cts +3 -0
  168. package/build/modern/mutationObserver.d.ts +3 -0
  169. package/build/{lib → modern}/mutationObserver.js +44 -32
  170. package/build/modern/mutationObserver.js.map +1 -0
  171. package/build/modern/notifyManager.cjs +97 -0
  172. package/build/modern/notifyManager.cjs.map +1 -0
  173. package/build/modern/notifyManager.d.cts +20 -0
  174. package/build/modern/notifyManager.d.ts +20 -0
  175. package/build/{lib/notifyManager.legacy.js → modern/notifyManager.js} +14 -31
  176. package/build/modern/notifyManager.js.map +1 -0
  177. package/build/modern/onlineManager.cjs +82 -0
  178. package/build/modern/onlineManager.cjs.map +1 -0
  179. package/build/modern/onlineManager.d.cts +16 -0
  180. package/build/modern/onlineManager.d.ts +16 -0
  181. package/build/{lib → modern}/onlineManager.js +14 -17
  182. package/build/modern/onlineManager.js.map +1 -0
  183. package/build/modern/queriesObserver.cjs +202 -0
  184. package/build/modern/queriesObserver.cjs.map +1 -0
  185. package/build/modern/queriesObserver.d.cts +26 -0
  186. package/build/modern/queriesObserver.d.ts +26 -0
  187. package/build/{lib → modern}/queriesObserver.js +69 -50
  188. package/build/modern/queriesObserver.js.map +1 -0
  189. package/build/{lib → modern}/query.cjs +143 -186
  190. package/build/modern/query.cjs.map +1 -0
  191. package/build/modern/query.d.cts +3 -0
  192. package/build/modern/query.d.ts +3 -0
  193. package/build/{lib → modern}/query.js +110 -175
  194. package/build/modern/query.js.map +1 -0
  195. package/build/modern/queryCache.cjs +120 -0
  196. package/build/modern/queryCache.cjs.map +1 -0
  197. package/build/modern/queryCache.d.cts +3 -0
  198. package/build/modern/queryCache.d.ts +3 -0
  199. package/build/{lib → modern}/queryCache.js +21 -29
  200. package/build/modern/queryCache.js.map +1 -0
  201. package/build/modern/queryClient-4ba6364e.d.ts +916 -0
  202. package/build/modern/queryClient-d615ed9f.d.ts +916 -0
  203. package/build/modern/queryClient.cjs +284 -0
  204. package/build/modern/queryClient.cjs.map +1 -0
  205. package/build/modern/queryClient.d.cts +3 -0
  206. package/build/modern/queryClient.d.ts +3 -0
  207. package/build/{lib → modern}/queryClient.js +77 -94
  208. package/build/modern/queryClient.js.map +1 -0
  209. package/build/{lib → modern}/queryObserver.cjs +133 -149
  210. package/build/modern/queryObserver.cjs.map +1 -0
  211. package/build/modern/queryObserver.d.cts +3 -0
  212. package/build/modern/queryObserver.d.ts +3 -0
  213. package/build/{lib → modern}/queryObserver.js +107 -138
  214. package/build/modern/queryObserver.js.map +1 -0
  215. package/build/modern/removable.cjs +55 -0
  216. package/build/modern/removable.cjs.map +1 -0
  217. package/build/modern/removable.d.cts +11 -0
  218. package/build/modern/removable.d.ts +11 -0
  219. package/build/{lib → modern}/removable.js +10 -8
  220. package/build/modern/removable.js.map +1 -0
  221. package/build/{lib → modern}/retryer.cjs +50 -44
  222. package/build/modern/retryer.cjs.map +1 -0
  223. package/build/modern/retryer.d.cts +3 -0
  224. package/build/modern/retryer.d.ts +3 -0
  225. package/build/{lib → modern}/retryer.js +23 -39
  226. package/build/modern/retryer.js.map +1 -0
  227. package/build/modern/subscribable.cjs +49 -0
  228. package/build/modern/subscribable.cjs.map +1 -0
  229. package/build/modern/subscribable.d.cts +11 -0
  230. package/build/modern/subscribable.d.ts +11 -0
  231. package/build/{lib/subscribable.legacy.js → modern/subscribable.js} +5 -6
  232. package/build/modern/subscribable.js.map +1 -0
  233. package/build/modern/types.cjs +17 -0
  234. package/build/modern/types.cjs.map +1 -0
  235. package/build/modern/types.d.cts +3 -0
  236. package/build/modern/types.d.ts +3 -0
  237. package/build/modern/types.js +1 -0
  238. package/build/modern/types.js.map +1 -0
  239. package/build/{lib → modern}/utils.cjs +92 -93
  240. package/build/modern/utils.cjs.map +1 -0
  241. package/build/modern/utils.d.cts +3 -0
  242. package/build/modern/utils.d.ts +3 -0
  243. package/build/{lib → modern}/utils.js +49 -72
  244. package/build/modern/utils.js.map +1 -0
  245. package/package.json +15 -13
  246. package/build/lib/_virtual/_rollupPluginBabelHelpers.legacy.cjs +0 -16
  247. package/build/lib/_virtual/_rollupPluginBabelHelpers.legacy.cjs.map +0 -1
  248. package/build/lib/_virtual/_rollupPluginBabelHelpers.legacy.js +0 -13
  249. package/build/lib/_virtual/_rollupPluginBabelHelpers.legacy.js.map +0 -1
  250. package/build/lib/focusManager.cjs +0 -75
  251. package/build/lib/focusManager.cjs.map +0 -1
  252. package/build/lib/focusManager.d.ts.map +0 -1
  253. package/build/lib/focusManager.js +0 -72
  254. package/build/lib/focusManager.js.map +0 -1
  255. package/build/lib/focusManager.legacy.cjs +0 -91
  256. package/build/lib/focusManager.legacy.cjs.map +0 -1
  257. package/build/lib/focusManager.legacy.js +0 -88
  258. package/build/lib/focusManager.legacy.js.map +0 -1
  259. package/build/lib/hydration.cjs +0 -97
  260. package/build/lib/hydration.cjs.map +0 -1
  261. package/build/lib/hydration.d.ts +0 -35
  262. package/build/lib/hydration.d.ts.map +0 -1
  263. package/build/lib/hydration.js +0 -92
  264. package/build/lib/hydration.js.map +0 -1
  265. package/build/lib/hydration.legacy.cjs +0 -100
  266. package/build/lib/hydration.legacy.cjs.map +0 -1
  267. package/build/lib/hydration.legacy.js +0 -95
  268. package/build/lib/hydration.legacy.js.map +0 -1
  269. package/build/lib/index.cjs +0 -40
  270. package/build/lib/index.cjs.map +0 -1
  271. package/build/lib/index.d.ts +0 -22
  272. package/build/lib/index.d.ts.map +0 -1
  273. package/build/lib/index.js +0 -14
  274. package/build/lib/index.js.map +0 -1
  275. package/build/lib/index.legacy.cjs +0 -40
  276. package/build/lib/index.legacy.cjs.map +0 -1
  277. package/build/lib/index.legacy.js +0 -14
  278. package/build/lib/index.legacy.js.map +0 -1
  279. package/build/lib/infiniteQueryBehavior.cjs +0 -123
  280. package/build/lib/infiniteQueryBehavior.cjs.map +0 -1
  281. package/build/lib/infiniteQueryBehavior.d.ts +0 -12
  282. package/build/lib/infiniteQueryBehavior.d.ts.map +0 -1
  283. package/build/lib/infiniteQueryBehavior.js.map +0 -1
  284. package/build/lib/infiniteQueryBehavior.legacy.cjs +0 -125
  285. package/build/lib/infiniteQueryBehavior.legacy.cjs.map +0 -1
  286. package/build/lib/infiniteQueryBehavior.legacy.js +0 -121
  287. package/build/lib/infiniteQueryBehavior.legacy.js.map +0 -1
  288. package/build/lib/infiniteQueryObserver.cjs +0 -77
  289. package/build/lib/infiniteQueryObserver.cjs.map +0 -1
  290. package/build/lib/infiniteQueryObserver.d.ts.map +0 -1
  291. package/build/lib/infiniteQueryObserver.js.map +0 -1
  292. package/build/lib/infiniteQueryObserver.legacy.cjs +0 -78
  293. package/build/lib/infiniteQueryObserver.legacy.cjs.map +0 -1
  294. package/build/lib/infiniteQueryObserver.legacy.js.map +0 -1
  295. package/build/lib/mutation.cjs +0 -237
  296. package/build/lib/mutation.cjs.map +0 -1
  297. package/build/lib/mutation.d.ts +0 -64
  298. package/build/lib/mutation.d.ts.map +0 -1
  299. package/build/lib/mutation.js.map +0 -1
  300. package/build/lib/mutation.legacy.cjs +0 -262
  301. package/build/lib/mutation.legacy.cjs.map +0 -1
  302. package/build/lib/mutation.legacy.js +0 -259
  303. package/build/lib/mutation.legacy.js.map +0 -1
  304. package/build/lib/mutationCache.cjs +0 -85
  305. package/build/lib/mutationCache.cjs.map +0 -1
  306. package/build/lib/mutationCache.d.ts +0 -59
  307. package/build/lib/mutationCache.d.ts.map +0 -1
  308. package/build/lib/mutationCache.js +0 -83
  309. package/build/lib/mutationCache.js.map +0 -1
  310. package/build/lib/mutationCache.legacy.cjs +0 -98
  311. package/build/lib/mutationCache.legacy.cjs.map +0 -1
  312. package/build/lib/mutationCache.legacy.js +0 -96
  313. package/build/lib/mutationCache.legacy.js.map +0 -1
  314. package/build/lib/mutationObserver.cjs +0 -98
  315. package/build/lib/mutationObserver.cjs.map +0 -1
  316. package/build/lib/mutationObserver.d.ts +0 -19
  317. package/build/lib/mutationObserver.d.ts.map +0 -1
  318. package/build/lib/mutationObserver.js.map +0 -1
  319. package/build/lib/mutationObserver.legacy.cjs +0 -128
  320. package/build/lib/mutationObserver.legacy.cjs.map +0 -1
  321. package/build/lib/mutationObserver.legacy.js +0 -126
  322. package/build/lib/mutationObserver.legacy.js.map +0 -1
  323. package/build/lib/notifyManager.cjs +0 -92
  324. package/build/lib/notifyManager.cjs.map +0 -1
  325. package/build/lib/notifyManager.d.ts.map +0 -1
  326. package/build/lib/notifyManager.js.map +0 -1
  327. package/build/lib/notifyManager.legacy.cjs +0 -92
  328. package/build/lib/notifyManager.legacy.cjs.map +0 -1
  329. package/build/lib/notifyManager.legacy.js.map +0 -1
  330. package/build/lib/onlineManager.cjs +0 -63
  331. package/build/lib/onlineManager.cjs.map +0 -1
  332. package/build/lib/onlineManager.d.ts.map +0 -1
  333. package/build/lib/onlineManager.js.map +0 -1
  334. package/build/lib/onlineManager.legacy.cjs +0 -78
  335. package/build/lib/onlineManager.legacy.cjs.map +0 -1
  336. package/build/lib/onlineManager.legacy.js +0 -75
  337. package/build/lib/onlineManager.legacy.js.map +0 -1
  338. package/build/lib/queriesObserver.cjs +0 -161
  339. package/build/lib/queriesObserver.cjs.map +0 -1
  340. package/build/lib/queriesObserver.d.ts.map +0 -1
  341. package/build/lib/queriesObserver.js.map +0 -1
  342. package/build/lib/queriesObserver.legacy.cjs +0 -207
  343. package/build/lib/queriesObserver.legacy.cjs.map +0 -1
  344. package/build/lib/queriesObserver.legacy.js +0 -205
  345. package/build/lib/queriesObserver.legacy.js.map +0 -1
  346. package/build/lib/query.cjs.map +0 -1
  347. package/build/lib/query.d.ts +0 -115
  348. package/build/lib/query.d.ts.map +0 -1
  349. package/build/lib/query.js.map +0 -1
  350. package/build/lib/query.legacy.cjs +0 -471
  351. package/build/lib/query.legacy.cjs.map +0 -1
  352. package/build/lib/query.legacy.js +0 -469
  353. package/build/lib/query.legacy.js.map +0 -1
  354. package/build/lib/queryCache.cjs +0 -106
  355. package/build/lib/queryCache.cjs.map +0 -1
  356. package/build/lib/queryCache.d.ts +0 -71
  357. package/build/lib/queryCache.d.ts.map +0 -1
  358. package/build/lib/queryCache.js.map +0 -1
  359. package/build/lib/queryCache.legacy.cjs +0 -111
  360. package/build/lib/queryCache.legacy.cjs.map +0 -1
  361. package/build/lib/queryCache.legacy.js +0 -109
  362. package/build/lib/queryCache.legacy.js.map +0 -1
  363. package/build/lib/queryClient.cjs +0 -285
  364. package/build/lib/queryClient.cjs.map +0 -1
  365. package/build/lib/queryClient.d.ts +0 -41
  366. package/build/lib/queryClient.d.ts.map +0 -1
  367. package/build/lib/queryClient.js.map +0 -1
  368. package/build/lib/queryClient.legacy.cjs +0 -322
  369. package/build/lib/queryClient.legacy.cjs.map +0 -1
  370. package/build/lib/queryClient.legacy.js +0 -320
  371. package/build/lib/queryClient.legacy.js.map +0 -1
  372. package/build/lib/queryObserver.cjs.map +0 -1
  373. package/build/lib/queryObserver.d.ts +0 -35
  374. package/build/lib/queryObserver.d.ts.map +0 -1
  375. package/build/lib/queryObserver.js.map +0 -1
  376. package/build/lib/queryObserver.legacy.cjs +0 -561
  377. package/build/lib/queryObserver.legacy.cjs.map +0 -1
  378. package/build/lib/queryObserver.legacy.js +0 -559
  379. package/build/lib/queryObserver.legacy.js.map +0 -1
  380. package/build/lib/removable.cjs +0 -31
  381. package/build/lib/removable.cjs.map +0 -1
  382. package/build/lib/removable.d.ts.map +0 -1
  383. package/build/lib/removable.js.map +0 -1
  384. package/build/lib/removable.legacy.cjs +0 -38
  385. package/build/lib/removable.legacy.cjs.map +0 -1
  386. package/build/lib/removable.legacy.js +0 -36
  387. package/build/lib/removable.legacy.js.map +0 -1
  388. package/build/lib/retryer.cjs.map +0 -1
  389. package/build/lib/retryer.d.ts +0 -34
  390. package/build/lib/retryer.d.ts.map +0 -1
  391. package/build/lib/retryer.js.map +0 -1
  392. package/build/lib/retryer.legacy.cjs +0 -158
  393. package/build/lib/retryer.legacy.cjs.map +0 -1
  394. package/build/lib/retryer.legacy.js.map +0 -1
  395. package/build/lib/subscribable.cjs +0 -28
  396. package/build/lib/subscribable.cjs.map +0 -1
  397. package/build/lib/subscribable.d.ts.map +0 -1
  398. package/build/lib/subscribable.js.map +0 -1
  399. package/build/lib/subscribable.legacy.cjs +0 -28
  400. package/build/lib/subscribable.legacy.cjs.map +0 -1
  401. package/build/lib/subscribable.legacy.js.map +0 -1
  402. package/build/lib/tests/focusManager.test.d.ts +0 -2
  403. package/build/lib/tests/focusManager.test.d.ts.map +0 -1
  404. package/build/lib/tests/hydration.test.d.ts +0 -2
  405. package/build/lib/tests/hydration.test.d.ts.map +0 -1
  406. package/build/lib/tests/infiniteQueryBehavior.test.d.ts +0 -2
  407. package/build/lib/tests/infiniteQueryBehavior.test.d.ts.map +0 -1
  408. package/build/lib/tests/infiniteQueryObserver.test.d.ts +0 -2
  409. package/build/lib/tests/infiniteQueryObserver.test.d.ts.map +0 -1
  410. package/build/lib/tests/mutationCache.test.d.ts +0 -2
  411. package/build/lib/tests/mutationCache.test.d.ts.map +0 -1
  412. package/build/lib/tests/mutationObserver.test.d.ts +0 -2
  413. package/build/lib/tests/mutationObserver.test.d.ts.map +0 -1
  414. package/build/lib/tests/mutations.test.d.ts +0 -2
  415. package/build/lib/tests/mutations.test.d.ts.map +0 -1
  416. package/build/lib/tests/notifyManager.test.d.ts +0 -2
  417. package/build/lib/tests/notifyManager.test.d.ts.map +0 -1
  418. package/build/lib/tests/onlineManager.test.d.ts +0 -2
  419. package/build/lib/tests/onlineManager.test.d.ts.map +0 -1
  420. package/build/lib/tests/queriesObserver.test.d.ts +0 -2
  421. package/build/lib/tests/queriesObserver.test.d.ts.map +0 -1
  422. package/build/lib/tests/query.test.d.ts +0 -2
  423. package/build/lib/tests/query.test.d.ts.map +0 -1
  424. package/build/lib/tests/queryCache.test.d.ts +0 -2
  425. package/build/lib/tests/queryCache.test.d.ts.map +0 -1
  426. package/build/lib/tests/queryClient.test.d.ts +0 -2
  427. package/build/lib/tests/queryClient.test.d.ts.map +0 -1
  428. package/build/lib/tests/queryObserver.test.d.ts +0 -2
  429. package/build/lib/tests/queryObserver.test.d.ts.map +0 -1
  430. package/build/lib/tests/utils.d.ts +0 -17
  431. package/build/lib/tests/utils.d.ts.map +0 -1
  432. package/build/lib/tests/utils.test.d.ts +0 -2
  433. package/build/lib/tests/utils.test.d.ts.map +0 -1
  434. package/build/lib/types.d.ts +0 -437
  435. package/build/lib/types.d.ts.map +0 -1
  436. package/build/lib/utils.cjs.map +0 -1
  437. package/build/lib/utils.d.ts +0 -90
  438. package/build/lib/utils.d.ts.map +0 -1
  439. package/build/lib/utils.js.map +0 -1
  440. package/build/lib/utils.legacy.cjs.map +0 -1
  441. package/build/lib/utils.legacy.js.map +0 -1
@@ -1,23 +1,31 @@
1
- 'use strict';
2
-
3
- var utils = require('./utils.cjs');
4
- var notifyManager = require('./notifyManager.cjs');
5
- var retryer = require('./retryer.cjs');
6
- var removable = require('./removable.cjs');
7
-
8
- // TYPES
9
-
10
- // CLASS
11
-
12
- class Query extends removable.Removable {
13
- #initialState;
14
- #revertState;
15
- #cache;
16
- #promise;
17
- #retryer;
18
- #observers;
19
- #defaultOptions;
20
- #abortSignalConsumed;
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var query_exports = {};
20
+ __export(query_exports, {
21
+ Query: () => Query
22
+ });
23
+ module.exports = __toCommonJS(query_exports);
24
+ var import_utils = require("./utils");
25
+ var import_notifyManager = require("./notifyManager");
26
+ var import_retryer = require("./retryer");
27
+ var import_removable = require("./removable");
28
+ class Query extends import_removable.Removable {
21
29
  constructor(config) {
22
30
  super();
23
31
  this.#abortSignalConsumed = false;
@@ -31,120 +39,97 @@ class Query extends removable.Removable {
31
39
  this.state = this.#initialState;
32
40
  this.scheduleGc();
33
41
  }
42
+ #initialState;
43
+ #revertState;
44
+ #cache;
45
+ #promise;
46
+ #retryer;
47
+ #observers;
48
+ #defaultOptions;
49
+ #abortSignalConsumed;
34
50
  get meta() {
35
51
  return this.options.meta;
36
52
  }
37
53
  #setOptions(options) {
38
- this.options = {
39
- ...this.#defaultOptions,
40
- ...options
41
- };
54
+ this.options = { ...this.#defaultOptions, ...options };
42
55
  this.updateGcTime(this.options.gcTime);
43
56
  }
44
57
  optionalRemove() {
45
- if (!this.#observers.length && this.state.fetchStatus === 'idle') {
58
+ if (!this.#observers.length && this.state.fetchStatus === "idle") {
46
59
  this.#cache.remove(this);
47
60
  }
48
61
  }
49
62
  setData(newData, options) {
50
- const data = utils.replaceData(this.state.data, newData, this.options);
51
-
52
- // Set data and mark it as cached
63
+ const data = (0, import_utils.replaceData)(this.state.data, newData, this.options);
53
64
  this.#dispatch({
54
65
  data,
55
- type: 'success',
66
+ type: "success",
56
67
  dataUpdatedAt: options?.updatedAt,
57
68
  manual: options?.manual
58
69
  });
59
70
  return data;
60
71
  }
61
72
  setState(state, setStateOptions) {
62
- this.#dispatch({
63
- type: 'setState',
64
- state,
65
- setStateOptions
66
- });
73
+ this.#dispatch({ type: "setState", state, setStateOptions });
67
74
  }
68
75
  cancel(options) {
69
76
  const promise = this.#promise;
70
77
  this.#retryer?.cancel(options);
71
- return promise ? promise.then(utils.noop).catch(utils.noop) : Promise.resolve();
78
+ return promise ? promise.then(import_utils.noop).catch(import_utils.noop) : Promise.resolve();
72
79
  }
73
80
  destroy() {
74
81
  super.destroy();
75
- this.cancel({
76
- silent: true
77
- });
82
+ this.cancel({ silent: true });
78
83
  }
79
84
  reset() {
80
85
  this.destroy();
81
86
  this.setState(this.#initialState);
82
87
  }
83
88
  isActive() {
84
- return this.#observers.some(observer => observer.options.enabled !== false);
89
+ return this.#observers.some(
90
+ (observer) => observer.options.enabled !== false
91
+ );
85
92
  }
86
93
  isDisabled() {
87
94
  return this.getObserversCount() > 0 && !this.isActive();
88
95
  }
89
96
  isStale() {
90
- return this.state.isInvalidated || !this.state.dataUpdatedAt || this.#observers.some(observer => observer.getCurrentResult().isStale);
97
+ return this.state.isInvalidated || !this.state.dataUpdatedAt || this.#observers.some((observer) => observer.getCurrentResult().isStale);
91
98
  }
92
99
  isStaleByTime(staleTime = 0) {
93
- return this.state.isInvalidated || !this.state.dataUpdatedAt || !utils.timeUntilStale(this.state.dataUpdatedAt, staleTime);
100
+ return this.state.isInvalidated || !this.state.dataUpdatedAt || !(0, import_utils.timeUntilStale)(this.state.dataUpdatedAt, staleTime);
94
101
  }
95
102
  onFocus() {
96
- const observer = this.#observers.find(x => x.shouldFetchOnWindowFocus());
97
- observer?.refetch({
98
- cancelRefetch: false
99
- });
100
-
101
- // Continue fetch if currently paused
103
+ const observer = this.#observers.find((x) => x.shouldFetchOnWindowFocus());
104
+ observer?.refetch({ cancelRefetch: false });
102
105
  this.#retryer?.continue();
103
106
  }
104
107
  onOnline() {
105
- const observer = this.#observers.find(x => x.shouldFetchOnReconnect());
106
- observer?.refetch({
107
- cancelRefetch: false
108
- });
109
-
110
- // Continue fetch if currently paused
108
+ const observer = this.#observers.find((x) => x.shouldFetchOnReconnect());
109
+ observer?.refetch({ cancelRefetch: false });
111
110
  this.#retryer?.continue();
112
111
  }
113
112
  addObserver(observer) {
114
113
  if (!this.#observers.includes(observer)) {
115
114
  this.#observers.push(observer);
116
-
117
- // Stop the query from being garbage collected
118
115
  this.clearGcTimeout();
119
- this.#cache.notify({
120
- type: 'observerAdded',
121
- query: this,
122
- observer
123
- });
116
+ this.#cache.notify({ type: "observerAdded", query: this, observer });
124
117
  }
125
118
  }
126
119
  removeObserver(observer) {
127
120
  if (this.#observers.includes(observer)) {
128
- this.#observers = this.#observers.filter(x => x !== observer);
121
+ this.#observers = this.#observers.filter((x) => x !== observer);
129
122
  if (!this.#observers.length) {
130
- // If the transport layer does not support cancellation
131
- // we'll let the query continue so the result can be cached
132
123
  if (this.#retryer) {
133
124
  if (this.#abortSignalConsumed) {
134
- this.#retryer.cancel({
135
- revert: true
136
- });
125
+ this.#retryer.cancel({ revert: true });
137
126
  } else {
138
127
  this.#retryer.cancelRetry();
139
128
  }
140
129
  }
141
130
  this.scheduleGc();
142
131
  }
143
- this.#cache.notify({
144
- type: 'observerRemoved',
145
- query: this,
146
- observer
147
- });
132
+ this.#cache.notify({ type: "observerRemoved", query: this, observer });
148
133
  }
149
134
  }
150
135
  getObserversCount() {
@@ -152,57 +137,41 @@ class Query extends removable.Removable {
152
137
  }
153
138
  invalidate() {
154
139
  if (!this.state.isInvalidated) {
155
- this.#dispatch({
156
- type: 'invalidate'
157
- });
140
+ this.#dispatch({ type: "invalidate" });
158
141
  }
159
142
  }
160
143
  fetch(options, fetchOptions) {
161
- if (this.state.fetchStatus !== 'idle') {
144
+ if (this.state.fetchStatus !== "idle") {
162
145
  if (this.state.dataUpdatedAt && fetchOptions?.cancelRefetch) {
163
- // Silently cancel current fetch if the user wants to cancel refetches
164
- this.cancel({
165
- silent: true
166
- });
146
+ this.cancel({ silent: true });
167
147
  } else if (this.#promise) {
168
- // make sure that retries that were potentially cancelled due to unmounts can continue
169
148
  this.#retryer?.continueRetry();
170
- // Return current promise if we are already fetching
171
149
  return this.#promise;
172
150
  }
173
151
  }
174
-
175
- // Update config if passed, otherwise the config from the last execution is used
176
152
  if (options) {
177
153
  this.#setOptions(options);
178
154
  }
179
-
180
- // Use the options from the first observer with a query function if no function is found.
181
- // This can happen when the query is hydrated or created with setQueryData.
182
155
  if (!this.options.queryFn) {
183
- const observer = this.#observers.find(x => x.options.queryFn);
156
+ const observer = this.#observers.find((x) => x.options.queryFn);
184
157
  if (observer) {
185
158
  this.#setOptions(observer.options);
186
159
  }
187
160
  }
188
- if (process.env.NODE_ENV !== 'production') {
161
+ if (process.env.NODE_ENV !== "production") {
189
162
  if (!Array.isArray(this.options.queryKey)) {
190
- console.error(`As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`);
163
+ console.error(
164
+ `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`
165
+ );
191
166
  }
192
167
  }
193
168
  const abortController = new AbortController();
194
-
195
- // Create query function context
196
169
  const queryFnContext = {
197
170
  queryKey: this.queryKey,
198
171
  meta: this.meta
199
172
  };
200
-
201
- // Adds an enumerable signal property to the object that
202
- // which sets abortSignalConsumed to true when the signal
203
- // is read.
204
- const addSignalProperty = object => {
205
- Object.defineProperty(object, 'signal', {
173
+ const addSignalProperty = (object) => {
174
+ Object.defineProperty(object, "signal", {
206
175
  enumerable: true,
207
176
  get: () => {
208
177
  this.#abortSignalConsumed = true;
@@ -211,17 +180,17 @@ class Query extends removable.Removable {
211
180
  });
212
181
  };
213
182
  addSignalProperty(queryFnContext);
214
-
215
- // Create fetch function
216
183
  const fetchFn = () => {
217
184
  if (!this.options.queryFn) {
218
- return Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`));
185
+ return Promise.reject(
186
+ new Error(`Missing queryFn: '${this.options.queryHash}'`)
187
+ );
219
188
  }
220
189
  this.#abortSignalConsumed = false;
221
- return this.options.queryFn(queryFnContext);
190
+ return this.options.queryFn(
191
+ queryFnContext
192
+ );
222
193
  };
223
-
224
- // Trigger behavior hook
225
194
  const context = {
226
195
  fetchOptions,
227
196
  options: this.options,
@@ -230,78 +199,70 @@ class Query extends removable.Removable {
230
199
  fetchFn
231
200
  };
232
201
  addSignalProperty(context);
233
- this.options.behavior?.onFetch(context);
234
-
235
- // Store state in case the current fetch needs to be reverted
202
+ this.options.behavior?.onFetch(
203
+ context
204
+ );
236
205
  this.#revertState = this.state;
237
-
238
- // Set to fetching state if not already in it
239
- if (this.state.fetchStatus === 'idle' || this.state.fetchMeta !== context.fetchOptions?.meta) {
240
- this.#dispatch({
241
- type: 'fetch',
242
- meta: context.fetchOptions?.meta
243
- });
206
+ if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) {
207
+ this.#dispatch({ type: "fetch", meta: context.fetchOptions?.meta });
244
208
  }
245
- const onError = error => {
246
- // Optimistically update state if needed
247
- if (!(retryer.isCancelledError(error) && error.silent)) {
209
+ const onError = (error) => {
210
+ if (!((0, import_retryer.isCancelledError)(error) && error.silent)) {
248
211
  this.#dispatch({
249
- type: 'error',
250
- error: error
212
+ type: "error",
213
+ error
251
214
  });
252
215
  }
253
- if (!retryer.isCancelledError(error)) {
254
- // Notify cache callback
255
- this.#cache.config.onError?.(error, this);
256
- this.#cache.config.onSettled?.(this.state.data, error, this);
216
+ if (!(0, import_retryer.isCancelledError)(error)) {
217
+ this.#cache.config.onError?.(
218
+ error,
219
+ this
220
+ );
221
+ this.#cache.config.onSettled?.(
222
+ this.state.data,
223
+ error,
224
+ this
225
+ );
257
226
  }
258
227
  if (!this.isFetchingOptimistic) {
259
- // Schedule query gc after fetching
260
228
  this.scheduleGc();
261
229
  }
262
230
  this.isFetchingOptimistic = false;
263
231
  };
264
-
265
- // Try to fetch the data
266
- this.#retryer = retryer.createRetryer({
232
+ this.#retryer = (0, import_retryer.createRetryer)({
267
233
  fn: context.fetchFn,
268
234
  abort: abortController.abort.bind(abortController),
269
- onSuccess: data => {
270
- if (typeof data === 'undefined') {
271
- if (process.env.NODE_ENV !== 'production') {
272
- 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}`);
235
+ onSuccess: (data) => {
236
+ if (typeof data === "undefined") {
237
+ if (process.env.NODE_ENV !== "production") {
238
+ console.error(
239
+ `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`
240
+ );
273
241
  }
274
242
  onError(new Error(`${this.queryHash} data is undefined`));
275
243
  return;
276
244
  }
277
245
  this.setData(data);
278
-
279
- // Notify cache callback
280
246
  this.#cache.config.onSuccess?.(data, this);
281
- this.#cache.config.onSettled?.(data, this.state.error, this);
247
+ this.#cache.config.onSettled?.(
248
+ data,
249
+ this.state.error,
250
+ this
251
+ );
282
252
  if (!this.isFetchingOptimistic) {
283
- // Schedule query gc after fetching
284
253
  this.scheduleGc();
285
254
  }
286
255
  this.isFetchingOptimistic = false;
287
256
  },
288
257
  onError,
289
258
  onFail: (failureCount, error) => {
290
- this.#dispatch({
291
- type: 'failed',
292
- failureCount,
293
- error
294
- });
259
+ this.#dispatch({ type: "failed", failureCount, error });
295
260
  },
296
261
  onPause: () => {
297
- this.#dispatch({
298
- type: 'pause'
299
- });
262
+ this.#dispatch({ type: "pause" });
300
263
  },
301
264
  onContinue: () => {
302
- this.#dispatch({
303
- type: 'continue'
304
- });
265
+ this.#dispatch({ type: "continue" });
305
266
  },
306
267
  retry: context.options.retry,
307
268
  retryDelay: context.options.retryDelay,
@@ -311,37 +272,37 @@ class Query extends removable.Removable {
311
272
  return this.#promise;
312
273
  }
313
274
  #dispatch(action) {
314
- const reducer = state => {
275
+ const reducer = (state) => {
315
276
  switch (action.type) {
316
- case 'failed':
277
+ case "failed":
317
278
  return {
318
279
  ...state,
319
280
  fetchFailureCount: action.failureCount,
320
281
  fetchFailureReason: action.error
321
282
  };
322
- case 'pause':
283
+ case "pause":
323
284
  return {
324
285
  ...state,
325
- fetchStatus: 'paused'
286
+ fetchStatus: "paused"
326
287
  };
327
- case 'continue':
288
+ case "continue":
328
289
  return {
329
290
  ...state,
330
- fetchStatus: 'fetching'
291
+ fetchStatus: "fetching"
331
292
  };
332
- case 'fetch':
293
+ case "fetch":
333
294
  return {
334
295
  ...state,
335
296
  fetchFailureCount: 0,
336
297
  fetchFailureReason: null,
337
298
  fetchMeta: action.meta ?? null,
338
- fetchStatus: retryer.canFetch(this.options.networkMode) ? 'fetching' : 'paused',
339
- ...(!state.dataUpdatedAt && {
299
+ fetchStatus: (0, import_retryer.canFetch)(this.options.networkMode) ? "fetching" : "paused",
300
+ ...!state.dataUpdatedAt && {
340
301
  error: null,
341
- status: 'pending'
342
- })
302
+ status: "pending"
303
+ }
343
304
  };
344
- case 'success':
305
+ case "success":
345
306
  return {
346
307
  ...state,
347
308
  data: action.data,
@@ -349,36 +310,34 @@ class Query extends removable.Removable {
349
310
  dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),
350
311
  error: null,
351
312
  isInvalidated: false,
352
- status: 'success',
353
- ...(!action.manual && {
354
- fetchStatus: 'idle',
313
+ status: "success",
314
+ ...!action.manual && {
315
+ fetchStatus: "idle",
355
316
  fetchFailureCount: 0,
356
317
  fetchFailureReason: null
357
- })
318
+ }
358
319
  };
359
- case 'error':
320
+ case "error":
360
321
  const error = action.error;
361
- if (retryer.isCancelledError(error) && error.revert && this.#revertState) {
362
- return {
363
- ...this.#revertState
364
- };
322
+ if ((0, import_retryer.isCancelledError)(error) && error.revert && this.#revertState) {
323
+ return { ...this.#revertState };
365
324
  }
366
325
  return {
367
326
  ...state,
368
- error: error,
327
+ error,
369
328
  errorUpdateCount: state.errorUpdateCount + 1,
370
329
  errorUpdatedAt: Date.now(),
371
330
  fetchFailureCount: state.fetchFailureCount + 1,
372
331
  fetchFailureReason: error,
373
- fetchStatus: 'idle',
374
- status: 'error'
332
+ fetchStatus: "idle",
333
+ status: "error"
375
334
  };
376
- case 'invalidate':
335
+ case "invalidate":
377
336
  return {
378
337
  ...state,
379
338
  isInvalidated: true
380
339
  };
381
- case 'setState':
340
+ case "setState":
382
341
  return {
383
342
  ...state,
384
343
  ...action.state
@@ -386,22 +345,18 @@ class Query extends removable.Removable {
386
345
  }
387
346
  };
388
347
  this.state = reducer(this.state);
389
- notifyManager.notifyManager.batch(() => {
390
- this.#observers.forEach(observer => {
348
+ import_notifyManager.notifyManager.batch(() => {
349
+ this.#observers.forEach((observer) => {
391
350
  observer.onQueryUpdate();
392
351
  });
393
- this.#cache.notify({
394
- query: this,
395
- type: 'updated',
396
- action
397
- });
352
+ this.#cache.notify({ query: this, type: "updated", action });
398
353
  });
399
354
  }
400
355
  }
401
356
  function getDefaultState(options) {
402
- const data = typeof options.initialData === 'function' ? options.initialData() : options.initialData;
403
- const hasData = typeof data !== 'undefined';
404
- const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === 'function' ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;
357
+ const data = typeof options.initialData === "function" ? options.initialData() : options.initialData;
358
+ const hasData = typeof data !== "undefined";
359
+ const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;
405
360
  return {
406
361
  data,
407
362
  dataUpdateCount: 0,
@@ -413,10 +368,12 @@ function getDefaultState(options) {
413
368
  fetchFailureReason: null,
414
369
  fetchMeta: null,
415
370
  isInvalidated: false,
416
- status: hasData ? 'success' : 'pending',
417
- fetchStatus: 'idle'
371
+ status: hasData ? "success" : "pending",
372
+ fetchStatus: "idle"
418
373
  };
419
374
  }
420
-
421
- exports.Query = Query;
422
- //# sourceMappingURL=query.cjs.map
375
+ // Annotate the CommonJS export names for ESM import in node:
376
+ 0 && (module.exports = {
377
+ Query
378
+ });
379
+ //# sourceMappingURL=query.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/query.ts"],"sourcesContent":["import { noop, replaceData, timeUntilStale } from './utils'\nimport { notifyManager } from './notifyManager'\nimport { canFetch, createRetryer, isCancelledError } from './retryer'\nimport { Removable } from './removable'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n} from './types'\nimport type { QueryCache } from './queryCache'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n cache: QueryCache\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions<TQueryFnData, TError, TData, TQueryKey>\n defaultOptions?: QueryOptions<TQueryFnData, TError, TData, TQueryKey>\n state?: QueryState<TData, TError>\n}\n\nexport interface QueryState<TData = unknown, TError = DefaultError> {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise<unknown>\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions<TQueryFnData, TError, TData, any>\n queryKey: TQueryKey\n state: QueryState<TData, TError>\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext<TQueryFnData, TError, TData, TQueryKey>,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n}\n\ninterface FailedAction<TError> {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction<TData> {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction<TError> {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction<TData, TError> {\n type: 'setState'\n state: Partial<QueryState<TData, TError>>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action<TData, TError> =\n | ContinueAction\n | ErrorAction<TError>\n | FailedAction<TError>\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction<TData, TError>\n | SuccessAction<TData>\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions<TQueryFnData, TError, TData, TQueryKey>\n state: QueryState<TData, TError>\n isFetchingOptimistic?: boolean\n\n #initialState: QueryState<TData, TError>\n #revertState?: QueryState<TData, TError>\n #cache: QueryCache\n #promise?: Promise<TData>\n #retryer?: Retryer<TData>\n #observers: QueryObserver<any, any, any, any, any>[]\n #defaultOptions?: QueryOptions<TQueryFnData, TError, TData, TQueryKey>\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig<TQueryFnData, TError, TData, TQueryKey>) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.#setOptions(config.options)\n this.#observers = []\n this.#cache = config.cache\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = config.state || getDefaultState(this.options)\n this.state = this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n #setOptions(\n options?: QueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n }\n\n protected optionalRemove() {\n if (!this.#observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial<QueryState<TData, TError>>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise<void> {\n const promise = this.#promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.#observers.some(\n (observer) => observer.options.enabled !== false,\n )\n }\n\n isDisabled(): boolean {\n return this.getObserversCount() > 0 && !this.isActive()\n }\n\n isStale(): boolean {\n return (\n this.state.isInvalidated ||\n !this.state.dataUpdatedAt ||\n this.#observers.some((observer) => observer.getCurrentResult().isStale)\n )\n }\n\n isStaleByTime(staleTime = 0): boolean {\n return (\n this.state.isInvalidated ||\n !this.state.dataUpdatedAt ||\n !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n )\n }\n\n onFocus(): void {\n const observer = this.#observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.#observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver<any, any, any, any, any>): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver<any, any, any, any, any>): void {\n if (this.#observers.includes(observer)) {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n if (!this.#observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.#observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n fetch(\n options?: QueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n fetchOptions?: FetchOptions,\n ): Promise<TData> {\n if (this.state.fetchStatus !== 'idle') {\n if (this.state.dataUpdatedAt && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetches\n this.cancel({ silent: true })\n } else if (this.#promise) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer?.continueRetry()\n // Return current promise if we are already fetching\n return this.#promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.#setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.#observers.find((x) => x.options.queryFn)\n if (observer) {\n this.#setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Create query function context\n const queryFnContext: Omit<QueryFunctionContext<TQueryKey>, 'signal'> = {\n queryKey: this.queryKey,\n meta: this.meta,\n }\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n addSignalProperty(queryFnContext)\n\n // Create fetch function\n const fetchFn = () => {\n if (!this.options.queryFn) {\n return Promise.reject(\n new Error(`Missing queryFn: '${this.options.queryHash}'`),\n )\n }\n this.#abortSignalConsumed = false\n return this.options.queryFn(\n queryFnContext as QueryFunctionContext<TQueryKey>,\n )\n }\n\n // Trigger behavior hook\n const context: Omit<\n FetchContext<TQueryFnData, TError, TData, TQueryKey>,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n\n this.options.behavior?.onFetch(\n context as FetchContext<TQueryFnData, TError, TData, TQueryKey>,\n )\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n const onError = (error: TError | { silent?: boolean }) => {\n // Optimistically update state if needed\n if (!(isCancelledError(error) && error.silent)) {\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n }\n\n if (!isCancelledError(error)) {\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query<any, any, any, any>,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query<any, any, any, any>,\n )\n }\n\n if (!this.isFetchingOptimistic) {\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n this.isFetchingOptimistic = false\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n fn: context.fetchFn as () => Promise<TData>,\n abort: abortController.abort.bind(abortController),\n onSuccess: (data) => {\n if (typeof data === 'undefined') {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n onError(new Error(`${this.queryHash} data is undefined`) as any)\n return\n }\n\n this.setData(data)\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query<any, any, any, any>)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query<any, any, any, any>,\n )\n\n if (!this.isFetchingOptimistic) {\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n this.isFetchingOptimistic = false\n },\n onError,\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n })\n\n this.#promise = this.#retryer.promise\n\n return this.#promise\n }\n\n #dispatch(action: Action<TData, TError>): void {\n const reducer = (\n state: QueryState<TData, TError>,\n ): QueryState<TData, TError> => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: action.meta ?? null,\n fetchStatus: canFetch(this.options.networkMode)\n ? 'fetching'\n : 'paused',\n ...(!state.dataUpdatedAt && {\n error: null,\n status: 'pending',\n }),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success',\n ...(!action.manual && {\n fetchStatus: 'idle',\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n case 'error':\n const error = action.error as unknown\n\n if (isCancelledError(error) && error.revert && this.#revertState) {\n return { ...this.#revertState }\n }\n\n return {\n ...state,\n error: error as TError,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error as TError,\n fetchStatus: 'idle',\n status: 'error',\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions<TQueryFnData, TError, TData, TQueryKey>,\n): QueryState<TData, TError> {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction<TData>)()\n : options.initialData\n\n const hasData = typeof data !== 'undefined'\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? (options.initialDataUpdatedAt as () => number | undefined)()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'pending',\n fetchStatus: 'idle',\n }\n}\n"],"mappings":";;;;;;;;;;;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M,mBAAmB;AAAA,YAC3C,gBAAgB,KAAK,IAAI;AAAA,YACzB,mBAAmB,MAAM,oBAAoB;AAAA,YAC7C,oBAAoB;AAAA,YACpB,aAAa;AAAA,YACb,QAAQ;AAAA,UACV;AAAA,QACF,KAAK;AACH,iBAAO;AAAA,YACL,GAAG;AAAA,YACH,eAAe;AAAA,UACjB;AAAA,QACF,KAAK;AACH,iBAAO;AAAA,YACL,GAAG;AAAA,YACH,GAAG,OAAO;AAAA,UACZ;AAAA,MACJ;AAAA,IACF;AAEA,SAAK,QAAQ,QAAQ,KAAK,KAAK;AAE/B,uCAAc,MAAM,MAAM;AACxB,WAAK,WAAW,QAAQ,CAAC,aAAa;AACpC,iBAAS,cAAc;AAAA,MACzB,CAAC;AAED,WAAK,OAAO,OAAO,EAAE,OAAO,MAAM,MAAM,WAAW,OAAO,CAAC;AAAA,IAC7D,CAAC;AAAA,EACH;AACF;AAEA,SAAS,gBAMP,SAC2B;AAC3B,QAAM,OACJ,OAAO,QAAQ,gBAAgB,aAC1B,QAAQ,YAA2C,IACpD,QAAQ;AAEd,QAAM,UAAU,OAAO,SAAS;AAEhC,QAAM,uBAAuB,UACzB,OAAO,QAAQ,yBAAyB,aACrC,QAAQ,qBAAkD,IAC3D,QAAQ,uBACV;AAEJ,SAAO;AAAA,IACL;AAAA,IACA,iBAAiB;AAAA,IACjB,eAAe,UAAU,wBAAwB,KAAK,IAAI,IAAI;AAAA,IAC9D,OAAO;AAAA,IACP,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,WAAW;AAAA,IACX,eAAe;AAAA,IACf,QAAQ,UAAU,YAAY;AAAA,IAC9B,aAAa;AAAA,EACf;AACF;","names":[]}
@@ -0,0 +1,3 @@
1
+ import './removable.cjs';
2
+ export { b1 as Action, aZ as FetchContext, a_ as FetchDirection, a$ as FetchMeta, b0 as FetchOptions, j as Query, ay as QueryBehavior, l as QueryState, b2 as SetStateOptions } from './queryClient-4ba6364e.js';
3
+ import './subscribable.cjs';
@@ -0,0 +1,3 @@
1
+ import './removable.js';
2
+ export { b1 as Action, aZ as FetchContext, a_ as FetchDirection, a$ as FetchMeta, b0 as FetchOptions, j as Query, ay as QueryBehavior, l as QueryState, b2 as SetStateOptions } from './queryClient-d615ed9f.js';
3
+ import './subscribable.js';