@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.
- package/build/legacy/focusManager.cjs +116 -0
- package/build/legacy/focusManager.cjs.map +1 -0
- package/build/legacy/focusManager.d.cts +16 -0
- package/build/{lib → legacy}/focusManager.d.ts +6 -5
- package/build/legacy/focusManager.js +91 -0
- package/build/legacy/focusManager.js.map +1 -0
- package/build/legacy/hydration.cjs +109 -0
- package/build/legacy/hydration.cjs.map +1 -0
- package/build/legacy/hydration.d.cts +35 -0
- package/build/legacy/hydration.d.ts +35 -0
- package/build/legacy/hydration.js +82 -0
- package/build/legacy/hydration.js.map +1 -0
- package/build/legacy/index.cjs +85 -0
- package/build/legacy/index.cjs.map +1 -0
- package/build/legacy/index.d.cts +9 -0
- package/build/legacy/index.d.ts +9 -0
- package/build/legacy/index.js +50 -0
- package/build/legacy/index.js.map +1 -0
- package/build/legacy/infiniteQueryBehavior.cjs +141 -0
- package/build/legacy/infiniteQueryBehavior.cjs.map +1 -0
- package/build/legacy/infiniteQueryBehavior.d.cts +15 -0
- package/build/legacy/infiniteQueryBehavior.d.ts +15 -0
- package/build/legacy/infiniteQueryBehavior.js +115 -0
- package/build/legacy/infiniteQueryBehavior.js.map +1 -0
- package/build/legacy/infiniteQueryObserver.cjs +88 -0
- package/build/legacy/infiniteQueryObserver.cjs.map +1 -0
- package/build/legacy/infiniteQueryObserver.d.cts +19 -0
- package/build/{lib → legacy}/infiniteQueryObserver.d.ts +7 -8
- package/build/{lib/infiniteQueryObserver.legacy.js → legacy/infiniteQueryObserver.js} +24 -32
- package/build/legacy/infiniteQueryObserver.js.map +1 -0
- package/build/legacy/mutation.cjs +297 -0
- package/build/legacy/mutation.cjs.map +1 -0
- package/build/legacy/mutation.d.cts +3 -0
- package/build/legacy/mutation.d.ts +3 -0
- package/build/legacy/mutation.js +272 -0
- package/build/legacy/mutation.js.map +1 -0
- package/build/legacy/mutationCache.cjs +133 -0
- package/build/legacy/mutationCache.cjs.map +1 -0
- package/build/legacy/mutationCache.d.cts +3 -0
- package/build/legacy/mutationCache.d.ts +3 -0
- package/build/legacy/mutationCache.js +109 -0
- package/build/legacy/mutationCache.js.map +1 -0
- package/build/legacy/mutationObserver.cjs +171 -0
- package/build/legacy/mutationObserver.cjs.map +1 -0
- package/build/legacy/mutationObserver.d.cts +3 -0
- package/build/legacy/mutationObserver.d.ts +3 -0
- package/build/legacy/mutationObserver.js +147 -0
- package/build/legacy/mutationObserver.js.map +1 -0
- package/build/legacy/notifyManager.cjs +97 -0
- package/build/legacy/notifyManager.cjs.map +1 -0
- package/build/legacy/notifyManager.d.cts +20 -0
- package/build/{lib → legacy}/notifyManager.d.ts +4 -4
- package/build/{lib → legacy}/notifyManager.js +14 -31
- package/build/legacy/notifyManager.js.map +1 -0
- package/build/legacy/onlineManager.cjs +106 -0
- package/build/legacy/onlineManager.cjs.map +1 -0
- package/build/legacy/onlineManager.d.cts +16 -0
- package/build/{lib → legacy}/onlineManager.d.ts +6 -5
- package/build/legacy/onlineManager.js +81 -0
- package/build/legacy/onlineManager.js.map +1 -0
- package/build/legacy/queriesObserver.cjs +242 -0
- package/build/legacy/queriesObserver.cjs.map +1 -0
- package/build/legacy/queriesObserver.d.cts +26 -0
- package/build/{lib → legacy}/queriesObserver.d.ts +10 -11
- package/build/legacy/queriesObserver.js +218 -0
- package/build/legacy/queriesObserver.js.map +1 -0
- package/build/legacy/query.cjs +423 -0
- package/build/legacy/query.cjs.map +1 -0
- package/build/legacy/query.d.cts +3 -0
- package/build/legacy/query.d.ts +3 -0
- package/build/legacy/query.js +399 -0
- package/build/legacy/query.js.map +1 -0
- package/build/legacy/queryCache.cjs +140 -0
- package/build/legacy/queryCache.cjs.map +1 -0
- package/build/legacy/queryCache.d.cts +3 -0
- package/build/legacy/queryCache.d.ts +3 -0
- package/build/legacy/queryCache.js +116 -0
- package/build/legacy/queryCache.js.map +1 -0
- package/build/legacy/queryClient-4ba6364e.d.ts +916 -0
- package/build/legacy/queryClient-d615ed9f.d.ts +916 -0
- package/build/legacy/queryClient.cjs +322 -0
- package/build/legacy/queryClient.cjs.map +1 -0
- package/build/legacy/queryClient.d.cts +3 -0
- package/build/legacy/queryClient.d.ts +3 -0
- package/build/legacy/queryClient.js +304 -0
- package/build/legacy/queryClient.js.map +1 -0
- package/build/legacy/queryObserver.cjs +501 -0
- package/build/legacy/queryObserver.cjs.map +1 -0
- package/build/legacy/queryObserver.d.cts +3 -0
- package/build/legacy/queryObserver.d.ts +3 -0
- package/build/legacy/queryObserver.js +484 -0
- package/build/legacy/queryObserver.js.map +1 -0
- package/build/legacy/removable.cjs +77 -0
- package/build/legacy/removable.cjs.map +1 -0
- package/build/legacy/removable.d.cts +11 -0
- package/build/{lib → legacy}/removable.d.ts +3 -2
- package/build/legacy/removable.js +53 -0
- package/build/legacy/removable.js.map +1 -0
- package/build/legacy/retryer.cjs +169 -0
- package/build/legacy/retryer.cjs.map +1 -0
- package/build/legacy/retryer.d.cts +3 -0
- package/build/legacy/retryer.d.ts +3 -0
- package/build/{lib/retryer.legacy.js → legacy/retryer.js} +37 -48
- package/build/legacy/retryer.js.map +1 -0
- package/build/legacy/subscribable.cjs +49 -0
- package/build/legacy/subscribable.cjs.map +1 -0
- package/build/legacy/subscribable.d.cts +11 -0
- package/build/{lib → legacy}/subscribable.d.ts +3 -3
- package/build/{lib → legacy}/subscribable.js +5 -6
- package/build/legacy/subscribable.js.map +1 -0
- package/build/legacy/types.cjs +17 -0
- package/build/legacy/types.cjs.map +1 -0
- package/build/legacy/types.d.cts +3 -0
- package/build/legacy/types.d.ts +3 -0
- package/build/legacy/types.js +1 -0
- package/build/legacy/types.js.map +1 -0
- package/build/{lib/utils.legacy.cjs → legacy/utils.cjs} +92 -93
- package/build/legacy/utils.cjs.map +1 -0
- package/build/legacy/utils.d.cts +3 -0
- package/build/legacy/utils.d.ts +3 -0
- package/build/{lib/utils.legacy.js → legacy/utils.js} +49 -72
- package/build/legacy/utils.js.map +1 -0
- package/build/modern/focusManager.cjs +91 -0
- package/build/modern/focusManager.cjs.map +1 -0
- package/build/modern/focusManager.d.cts +16 -0
- package/build/modern/focusManager.d.ts +16 -0
- package/build/modern/focusManager.js +66 -0
- package/build/modern/focusManager.js.map +1 -0
- package/build/modern/hydration.cjs +107 -0
- package/build/modern/hydration.cjs.map +1 -0
- package/build/modern/hydration.d.cts +35 -0
- package/build/modern/hydration.d.ts +35 -0
- package/build/modern/hydration.js +80 -0
- package/build/modern/hydration.js.map +1 -0
- package/build/modern/index.cjs +85 -0
- package/build/modern/index.cjs.map +1 -0
- package/build/modern/index.d.cts +9 -0
- package/build/modern/index.d.ts +9 -0
- package/build/modern/index.js +50 -0
- package/build/modern/index.js.map +1 -0
- package/build/modern/infiniteQueryBehavior.cjs +138 -0
- package/build/modern/infiniteQueryBehavior.cjs.map +1 -0
- package/build/modern/infiniteQueryBehavior.d.cts +15 -0
- package/build/modern/infiniteQueryBehavior.d.ts +15 -0
- package/build/{lib → modern}/infiniteQueryBehavior.js +46 -53
- package/build/modern/infiniteQueryBehavior.js.map +1 -0
- package/build/modern/infiniteQueryObserver.cjs +87 -0
- package/build/modern/infiniteQueryObserver.cjs.map +1 -0
- package/build/modern/infiniteQueryObserver.d.cts +19 -0
- package/build/modern/infiniteQueryObserver.d.ts +19 -0
- package/build/{lib → modern}/infiniteQueryObserver.js +23 -31
- package/build/modern/infiniteQueryObserver.js.map +1 -0
- package/build/modern/mutation.cjs +259 -0
- package/build/modern/mutation.cjs.map +1 -0
- package/build/modern/mutation.d.cts +3 -0
- package/build/modern/mutation.d.ts +3 -0
- package/build/{lib → modern}/mutation.js +86 -86
- package/build/modern/mutation.js.map +1 -0
- package/build/modern/mutationCache.cjs +103 -0
- package/build/modern/mutationCache.cjs.map +1 -0
- package/build/modern/mutationCache.d.cts +3 -0
- package/build/modern/mutationCache.d.ts +3 -0
- package/build/modern/mutationCache.js +79 -0
- package/build/modern/mutationCache.js.map +1 -0
- package/build/modern/mutationObserver.cjs +132 -0
- package/build/modern/mutationObserver.cjs.map +1 -0
- package/build/modern/mutationObserver.d.cts +3 -0
- package/build/modern/mutationObserver.d.ts +3 -0
- package/build/{lib → modern}/mutationObserver.js +44 -32
- package/build/modern/mutationObserver.js.map +1 -0
- package/build/modern/notifyManager.cjs +97 -0
- package/build/modern/notifyManager.cjs.map +1 -0
- package/build/modern/notifyManager.d.cts +20 -0
- package/build/modern/notifyManager.d.ts +20 -0
- package/build/{lib/notifyManager.legacy.js → modern/notifyManager.js} +14 -31
- package/build/modern/notifyManager.js.map +1 -0
- package/build/modern/onlineManager.cjs +82 -0
- package/build/modern/onlineManager.cjs.map +1 -0
- package/build/modern/onlineManager.d.cts +16 -0
- package/build/modern/onlineManager.d.ts +16 -0
- package/build/{lib → modern}/onlineManager.js +14 -17
- package/build/modern/onlineManager.js.map +1 -0
- package/build/modern/queriesObserver.cjs +202 -0
- package/build/modern/queriesObserver.cjs.map +1 -0
- package/build/modern/queriesObserver.d.cts +26 -0
- package/build/modern/queriesObserver.d.ts +26 -0
- package/build/{lib → modern}/queriesObserver.js +69 -50
- package/build/modern/queriesObserver.js.map +1 -0
- package/build/{lib → modern}/query.cjs +143 -186
- package/build/modern/query.cjs.map +1 -0
- package/build/modern/query.d.cts +3 -0
- package/build/modern/query.d.ts +3 -0
- package/build/{lib → modern}/query.js +110 -175
- package/build/modern/query.js.map +1 -0
- package/build/modern/queryCache.cjs +120 -0
- package/build/modern/queryCache.cjs.map +1 -0
- package/build/modern/queryCache.d.cts +3 -0
- package/build/modern/queryCache.d.ts +3 -0
- package/build/{lib → modern}/queryCache.js +21 -29
- package/build/modern/queryCache.js.map +1 -0
- package/build/modern/queryClient-4ba6364e.d.ts +916 -0
- package/build/modern/queryClient-d615ed9f.d.ts +916 -0
- package/build/modern/queryClient.cjs +284 -0
- package/build/modern/queryClient.cjs.map +1 -0
- package/build/modern/queryClient.d.cts +3 -0
- package/build/modern/queryClient.d.ts +3 -0
- package/build/{lib → modern}/queryClient.js +77 -94
- package/build/modern/queryClient.js.map +1 -0
- package/build/{lib → modern}/queryObserver.cjs +133 -149
- package/build/modern/queryObserver.cjs.map +1 -0
- package/build/modern/queryObserver.d.cts +3 -0
- package/build/modern/queryObserver.d.ts +3 -0
- package/build/{lib → modern}/queryObserver.js +107 -138
- package/build/modern/queryObserver.js.map +1 -0
- package/build/modern/removable.cjs +55 -0
- package/build/modern/removable.cjs.map +1 -0
- package/build/modern/removable.d.cts +11 -0
- package/build/modern/removable.d.ts +11 -0
- package/build/{lib → modern}/removable.js +10 -8
- package/build/modern/removable.js.map +1 -0
- package/build/{lib → modern}/retryer.cjs +50 -44
- package/build/modern/retryer.cjs.map +1 -0
- package/build/modern/retryer.d.cts +3 -0
- package/build/modern/retryer.d.ts +3 -0
- package/build/{lib → modern}/retryer.js +23 -39
- package/build/modern/retryer.js.map +1 -0
- package/build/modern/subscribable.cjs +49 -0
- package/build/modern/subscribable.cjs.map +1 -0
- package/build/modern/subscribable.d.cts +11 -0
- package/build/modern/subscribable.d.ts +11 -0
- package/build/{lib/subscribable.legacy.js → modern/subscribable.js} +5 -6
- package/build/modern/subscribable.js.map +1 -0
- package/build/modern/types.cjs +17 -0
- package/build/modern/types.cjs.map +1 -0
- package/build/modern/types.d.cts +3 -0
- package/build/modern/types.d.ts +3 -0
- package/build/modern/types.js +1 -0
- package/build/modern/types.js.map +1 -0
- package/build/{lib → modern}/utils.cjs +92 -93
- package/build/modern/utils.cjs.map +1 -0
- package/build/modern/utils.d.cts +3 -0
- package/build/modern/utils.d.ts +3 -0
- package/build/{lib → modern}/utils.js +49 -72
- package/build/modern/utils.js.map +1 -0
- package/package.json +15 -13
- package/build/lib/_virtual/_rollupPluginBabelHelpers.legacy.cjs +0 -16
- package/build/lib/_virtual/_rollupPluginBabelHelpers.legacy.cjs.map +0 -1
- package/build/lib/_virtual/_rollupPluginBabelHelpers.legacy.js +0 -13
- package/build/lib/_virtual/_rollupPluginBabelHelpers.legacy.js.map +0 -1
- package/build/lib/focusManager.cjs +0 -75
- package/build/lib/focusManager.cjs.map +0 -1
- package/build/lib/focusManager.d.ts.map +0 -1
- package/build/lib/focusManager.js +0 -72
- package/build/lib/focusManager.js.map +0 -1
- package/build/lib/focusManager.legacy.cjs +0 -91
- package/build/lib/focusManager.legacy.cjs.map +0 -1
- package/build/lib/focusManager.legacy.js +0 -88
- package/build/lib/focusManager.legacy.js.map +0 -1
- package/build/lib/hydration.cjs +0 -97
- package/build/lib/hydration.cjs.map +0 -1
- package/build/lib/hydration.d.ts +0 -35
- package/build/lib/hydration.d.ts.map +0 -1
- package/build/lib/hydration.js +0 -92
- package/build/lib/hydration.js.map +0 -1
- package/build/lib/hydration.legacy.cjs +0 -100
- package/build/lib/hydration.legacy.cjs.map +0 -1
- package/build/lib/hydration.legacy.js +0 -95
- package/build/lib/hydration.legacy.js.map +0 -1
- package/build/lib/index.cjs +0 -40
- package/build/lib/index.cjs.map +0 -1
- package/build/lib/index.d.ts +0 -22
- package/build/lib/index.d.ts.map +0 -1
- package/build/lib/index.js +0 -14
- package/build/lib/index.js.map +0 -1
- package/build/lib/index.legacy.cjs +0 -40
- package/build/lib/index.legacy.cjs.map +0 -1
- package/build/lib/index.legacy.js +0 -14
- package/build/lib/index.legacy.js.map +0 -1
- package/build/lib/infiniteQueryBehavior.cjs +0 -123
- package/build/lib/infiniteQueryBehavior.cjs.map +0 -1
- package/build/lib/infiniteQueryBehavior.d.ts +0 -12
- package/build/lib/infiniteQueryBehavior.d.ts.map +0 -1
- package/build/lib/infiniteQueryBehavior.js.map +0 -1
- package/build/lib/infiniteQueryBehavior.legacy.cjs +0 -125
- package/build/lib/infiniteQueryBehavior.legacy.cjs.map +0 -1
- package/build/lib/infiniteQueryBehavior.legacy.js +0 -121
- package/build/lib/infiniteQueryBehavior.legacy.js.map +0 -1
- package/build/lib/infiniteQueryObserver.cjs +0 -77
- package/build/lib/infiniteQueryObserver.cjs.map +0 -1
- package/build/lib/infiniteQueryObserver.d.ts.map +0 -1
- package/build/lib/infiniteQueryObserver.js.map +0 -1
- package/build/lib/infiniteQueryObserver.legacy.cjs +0 -78
- package/build/lib/infiniteQueryObserver.legacy.cjs.map +0 -1
- package/build/lib/infiniteQueryObserver.legacy.js.map +0 -1
- package/build/lib/mutation.cjs +0 -237
- package/build/lib/mutation.cjs.map +0 -1
- package/build/lib/mutation.d.ts +0 -64
- package/build/lib/mutation.d.ts.map +0 -1
- package/build/lib/mutation.js.map +0 -1
- package/build/lib/mutation.legacy.cjs +0 -262
- package/build/lib/mutation.legacy.cjs.map +0 -1
- package/build/lib/mutation.legacy.js +0 -259
- package/build/lib/mutation.legacy.js.map +0 -1
- package/build/lib/mutationCache.cjs +0 -85
- package/build/lib/mutationCache.cjs.map +0 -1
- package/build/lib/mutationCache.d.ts +0 -59
- package/build/lib/mutationCache.d.ts.map +0 -1
- package/build/lib/mutationCache.js +0 -83
- package/build/lib/mutationCache.js.map +0 -1
- package/build/lib/mutationCache.legacy.cjs +0 -98
- package/build/lib/mutationCache.legacy.cjs.map +0 -1
- package/build/lib/mutationCache.legacy.js +0 -96
- package/build/lib/mutationCache.legacy.js.map +0 -1
- package/build/lib/mutationObserver.cjs +0 -98
- package/build/lib/mutationObserver.cjs.map +0 -1
- package/build/lib/mutationObserver.d.ts +0 -19
- package/build/lib/mutationObserver.d.ts.map +0 -1
- package/build/lib/mutationObserver.js.map +0 -1
- package/build/lib/mutationObserver.legacy.cjs +0 -128
- package/build/lib/mutationObserver.legacy.cjs.map +0 -1
- package/build/lib/mutationObserver.legacy.js +0 -126
- package/build/lib/mutationObserver.legacy.js.map +0 -1
- package/build/lib/notifyManager.cjs +0 -92
- package/build/lib/notifyManager.cjs.map +0 -1
- package/build/lib/notifyManager.d.ts.map +0 -1
- package/build/lib/notifyManager.js.map +0 -1
- package/build/lib/notifyManager.legacy.cjs +0 -92
- package/build/lib/notifyManager.legacy.cjs.map +0 -1
- package/build/lib/notifyManager.legacy.js.map +0 -1
- package/build/lib/onlineManager.cjs +0 -63
- package/build/lib/onlineManager.cjs.map +0 -1
- package/build/lib/onlineManager.d.ts.map +0 -1
- package/build/lib/onlineManager.js.map +0 -1
- package/build/lib/onlineManager.legacy.cjs +0 -78
- package/build/lib/onlineManager.legacy.cjs.map +0 -1
- package/build/lib/onlineManager.legacy.js +0 -75
- package/build/lib/onlineManager.legacy.js.map +0 -1
- package/build/lib/queriesObserver.cjs +0 -161
- package/build/lib/queriesObserver.cjs.map +0 -1
- package/build/lib/queriesObserver.d.ts.map +0 -1
- package/build/lib/queriesObserver.js.map +0 -1
- package/build/lib/queriesObserver.legacy.cjs +0 -207
- package/build/lib/queriesObserver.legacy.cjs.map +0 -1
- package/build/lib/queriesObserver.legacy.js +0 -205
- package/build/lib/queriesObserver.legacy.js.map +0 -1
- package/build/lib/query.cjs.map +0 -1
- package/build/lib/query.d.ts +0 -115
- package/build/lib/query.d.ts.map +0 -1
- package/build/lib/query.js.map +0 -1
- package/build/lib/query.legacy.cjs +0 -471
- package/build/lib/query.legacy.cjs.map +0 -1
- package/build/lib/query.legacy.js +0 -469
- package/build/lib/query.legacy.js.map +0 -1
- package/build/lib/queryCache.cjs +0 -106
- package/build/lib/queryCache.cjs.map +0 -1
- package/build/lib/queryCache.d.ts +0 -71
- package/build/lib/queryCache.d.ts.map +0 -1
- package/build/lib/queryCache.js.map +0 -1
- package/build/lib/queryCache.legacy.cjs +0 -111
- package/build/lib/queryCache.legacy.cjs.map +0 -1
- package/build/lib/queryCache.legacy.js +0 -109
- package/build/lib/queryCache.legacy.js.map +0 -1
- package/build/lib/queryClient.cjs +0 -285
- package/build/lib/queryClient.cjs.map +0 -1
- package/build/lib/queryClient.d.ts +0 -41
- package/build/lib/queryClient.d.ts.map +0 -1
- package/build/lib/queryClient.js.map +0 -1
- package/build/lib/queryClient.legacy.cjs +0 -322
- package/build/lib/queryClient.legacy.cjs.map +0 -1
- package/build/lib/queryClient.legacy.js +0 -320
- package/build/lib/queryClient.legacy.js.map +0 -1
- package/build/lib/queryObserver.cjs.map +0 -1
- package/build/lib/queryObserver.d.ts +0 -35
- package/build/lib/queryObserver.d.ts.map +0 -1
- package/build/lib/queryObserver.js.map +0 -1
- package/build/lib/queryObserver.legacy.cjs +0 -561
- package/build/lib/queryObserver.legacy.cjs.map +0 -1
- package/build/lib/queryObserver.legacy.js +0 -559
- package/build/lib/queryObserver.legacy.js.map +0 -1
- package/build/lib/removable.cjs +0 -31
- package/build/lib/removable.cjs.map +0 -1
- package/build/lib/removable.d.ts.map +0 -1
- package/build/lib/removable.js.map +0 -1
- package/build/lib/removable.legacy.cjs +0 -38
- package/build/lib/removable.legacy.cjs.map +0 -1
- package/build/lib/removable.legacy.js +0 -36
- package/build/lib/removable.legacy.js.map +0 -1
- package/build/lib/retryer.cjs.map +0 -1
- package/build/lib/retryer.d.ts +0 -34
- package/build/lib/retryer.d.ts.map +0 -1
- package/build/lib/retryer.js.map +0 -1
- package/build/lib/retryer.legacy.cjs +0 -158
- package/build/lib/retryer.legacy.cjs.map +0 -1
- package/build/lib/retryer.legacy.js.map +0 -1
- package/build/lib/subscribable.cjs +0 -28
- package/build/lib/subscribable.cjs.map +0 -1
- package/build/lib/subscribable.d.ts.map +0 -1
- package/build/lib/subscribable.js.map +0 -1
- package/build/lib/subscribable.legacy.cjs +0 -28
- package/build/lib/subscribable.legacy.cjs.map +0 -1
- package/build/lib/subscribable.legacy.js.map +0 -1
- package/build/lib/tests/focusManager.test.d.ts +0 -2
- package/build/lib/tests/focusManager.test.d.ts.map +0 -1
- package/build/lib/tests/hydration.test.d.ts +0 -2
- package/build/lib/tests/hydration.test.d.ts.map +0 -1
- package/build/lib/tests/infiniteQueryBehavior.test.d.ts +0 -2
- package/build/lib/tests/infiniteQueryBehavior.test.d.ts.map +0 -1
- package/build/lib/tests/infiniteQueryObserver.test.d.ts +0 -2
- package/build/lib/tests/infiniteQueryObserver.test.d.ts.map +0 -1
- package/build/lib/tests/mutationCache.test.d.ts +0 -2
- package/build/lib/tests/mutationCache.test.d.ts.map +0 -1
- package/build/lib/tests/mutationObserver.test.d.ts +0 -2
- package/build/lib/tests/mutationObserver.test.d.ts.map +0 -1
- package/build/lib/tests/mutations.test.d.ts +0 -2
- package/build/lib/tests/mutations.test.d.ts.map +0 -1
- package/build/lib/tests/notifyManager.test.d.ts +0 -2
- package/build/lib/tests/notifyManager.test.d.ts.map +0 -1
- package/build/lib/tests/onlineManager.test.d.ts +0 -2
- package/build/lib/tests/onlineManager.test.d.ts.map +0 -1
- package/build/lib/tests/queriesObserver.test.d.ts +0 -2
- package/build/lib/tests/queriesObserver.test.d.ts.map +0 -1
- package/build/lib/tests/query.test.d.ts +0 -2
- package/build/lib/tests/query.test.d.ts.map +0 -1
- package/build/lib/tests/queryCache.test.d.ts +0 -2
- package/build/lib/tests/queryCache.test.d.ts.map +0 -1
- package/build/lib/tests/queryClient.test.d.ts +0 -2
- package/build/lib/tests/queryClient.test.d.ts.map +0 -1
- package/build/lib/tests/queryObserver.test.d.ts +0 -2
- package/build/lib/tests/queryObserver.test.d.ts.map +0 -1
- package/build/lib/tests/utils.d.ts +0 -17
- package/build/lib/tests/utils.d.ts.map +0 -1
- package/build/lib/tests/utils.test.d.ts +0 -2
- package/build/lib/tests/utils.test.d.ts.map +0 -1
- package/build/lib/types.d.ts +0 -437
- package/build/lib/types.d.ts.map +0 -1
- package/build/lib/utils.cjs.map +0 -1
- package/build/lib/utils.d.ts +0 -90
- package/build/lib/utils.d.ts.map +0 -1
- package/build/lib/utils.js.map +0 -1
- package/build/lib/utils.legacy.cjs.map +0 -1
- package/build/lib/utils.legacy.js.map +0 -1
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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 ===
|
|
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 =
|
|
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:
|
|
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(
|
|
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(
|
|
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 || !
|
|
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 !==
|
|
144
|
+
if (this.state.fetchStatus !== "idle") {
|
|
162
145
|
if (this.state.dataUpdatedAt && fetchOptions?.cancelRefetch) {
|
|
163
|
-
|
|
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 !==
|
|
161
|
+
if (process.env.NODE_ENV !== "production") {
|
|
189
162
|
if (!Array.isArray(this.options.queryKey)) {
|
|
190
|
-
console.error(
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
234
|
-
|
|
235
|
-
|
|
202
|
+
this.options.behavior?.onFetch(
|
|
203
|
+
context
|
|
204
|
+
);
|
|
236
205
|
this.#revertState = this.state;
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
|
|
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:
|
|
250
|
-
error
|
|
212
|
+
type: "error",
|
|
213
|
+
error
|
|
251
214
|
});
|
|
252
215
|
}
|
|
253
|
-
if (!
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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 ===
|
|
271
|
-
if (process.env.NODE_ENV !==
|
|
272
|
-
console.error(
|
|
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?.(
|
|
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
|
|
277
|
+
case "failed":
|
|
317
278
|
return {
|
|
318
279
|
...state,
|
|
319
280
|
fetchFailureCount: action.failureCount,
|
|
320
281
|
fetchFailureReason: action.error
|
|
321
282
|
};
|
|
322
|
-
case
|
|
283
|
+
case "pause":
|
|
323
284
|
return {
|
|
324
285
|
...state,
|
|
325
|
-
fetchStatus:
|
|
286
|
+
fetchStatus: "paused"
|
|
326
287
|
};
|
|
327
|
-
case
|
|
288
|
+
case "continue":
|
|
328
289
|
return {
|
|
329
290
|
...state,
|
|
330
|
-
fetchStatus:
|
|
291
|
+
fetchStatus: "fetching"
|
|
331
292
|
};
|
|
332
|
-
case
|
|
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:
|
|
339
|
-
|
|
299
|
+
fetchStatus: (0, import_retryer.canFetch)(this.options.networkMode) ? "fetching" : "paused",
|
|
300
|
+
...!state.dataUpdatedAt && {
|
|
340
301
|
error: null,
|
|
341
|
-
status:
|
|
342
|
-
}
|
|
302
|
+
status: "pending"
|
|
303
|
+
}
|
|
343
304
|
};
|
|
344
|
-
case
|
|
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:
|
|
353
|
-
|
|
354
|
-
fetchStatus:
|
|
313
|
+
status: "success",
|
|
314
|
+
...!action.manual && {
|
|
315
|
+
fetchStatus: "idle",
|
|
355
316
|
fetchFailureCount: 0,
|
|
356
317
|
fetchFailureReason: null
|
|
357
|
-
}
|
|
318
|
+
}
|
|
358
319
|
};
|
|
359
|
-
case
|
|
320
|
+
case "error":
|
|
360
321
|
const error = action.error;
|
|
361
|
-
if (
|
|
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
|
|
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:
|
|
374
|
-
status:
|
|
332
|
+
fetchStatus: "idle",
|
|
333
|
+
status: "error"
|
|
375
334
|
};
|
|
376
|
-
case
|
|
335
|
+
case "invalidate":
|
|
377
336
|
return {
|
|
378
337
|
...state,
|
|
379
338
|
isInvalidated: true
|
|
380
339
|
};
|
|
381
|
-
case
|
|
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
|
-
|
|
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 ===
|
|
403
|
-
const hasData = typeof data !==
|
|
404
|
-
const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt ===
|
|
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 ?
|
|
417
|
-
fetchStatus:
|
|
371
|
+
status: hasData ? "success" : "pending",
|
|
372
|
+
fetchStatus: "idle"
|
|
418
373
|
};
|
|
419
374
|
}
|
|
420
|
-
|
|
421
|
-
exports
|
|
422
|
-
|
|
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":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkD;AAClD,2BAA8B;AAC9B,qBAA0D;AAC1D,uBAA0B;AA6InB,MAAM,cAKH,2BAAU;AAAA,EAgBlB,YAAY,QAA6D;AACvE,UAAM;AAEN,SAAK,uBAAuB;AAC5B,SAAK,kBAAkB,OAAO;AAC9B,SAAK,YAAY,OAAO,OAAO;AAC/B,SAAK,aAAa,CAAC;AACnB,SAAK,SAAS,OAAO;AACrB,SAAK,WAAW,OAAO;AACvB,SAAK,YAAY,OAAO;AACxB,SAAK,gBAAgB,OAAO,SAAS,gBAAgB,KAAK,OAAO;AACjE,SAAK,QAAQ,KAAK;AAClB,SAAK,WAAW;AAAA,EAClB;AAAA,EAtBA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAgBA,IAAI,OAA8B;AAChC,WAAO,KAAK,QAAQ;AAAA,EACtB;AAAA,EAEA,YACE,SACM;AACN,SAAK,UAAU,EAAE,GA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