@tanstack/query-core 5.105.0 → 5.105.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/legacy/{classPrivateFieldSet2-CukOTU3U.js → classPrivateFieldSet2-CWIQ5CvM.js} +5 -10
- package/build/legacy/{classPrivateFieldSet2-CvCEk6bM.cjs → classPrivateFieldSet2-C_J9s9he.cjs} +5 -10
- package/build/legacy/{classPrivateMethodInitSpec-Nr6mgZRs.cjs → classPrivateMethodInitSpec-BMGv9vbZ.cjs} +2 -3
- package/build/legacy/{classPrivateMethodInitSpec-CgB-WYk3.js → classPrivateMethodInitSpec-DipaBicy.js} +2 -3
- package/build/legacy/environmentManager.cjs +1 -2
- package/build/legacy/environmentManager.d.cts +0 -2
- package/build/legacy/environmentManager.d.cts.map +1 -1
- package/build/legacy/environmentManager.d.ts +0 -2
- package/build/legacy/environmentManager.d.ts.map +1 -1
- package/build/legacy/environmentManager.js +1 -2
- package/build/legacy/focusManager.cjs +2 -3
- package/build/legacy/focusManager.d.cts +1 -3
- package/build/legacy/focusManager.d.cts.map +1 -1
- package/build/legacy/focusManager.d.ts +1 -3
- package/build/legacy/focusManager.d.ts.map +1 -1
- package/build/legacy/focusManager.js +2 -3
- package/build/{modern/hydration-CS3HS-a9.d.ts → legacy/hydration-BXjqUj_D.d.cts} +28 -39
- package/build/legacy/hydration-BXjqUj_D.d.cts.map +1 -0
- package/build/legacy/{hydration-CS3HS-a9.d.ts → hydration-vgIjIhk6.d.ts} +28 -39
- package/build/legacy/hydration-vgIjIhk6.d.ts.map +1 -0
- package/build/legacy/hydration.cjs +1 -2
- package/build/legacy/hydration.d.cts +1 -1
- package/build/legacy/hydration.d.ts +1 -1
- package/build/legacy/hydration.js +1 -2
- package/build/legacy/index.cjs +1 -2
- package/build/legacy/index.d.cts +1 -1
- package/build/legacy/index.d.ts +1 -1
- package/build/legacy/index.js +1 -2
- package/build/legacy/infiniteQueryBehavior.cjs +3 -3
- package/build/legacy/infiniteQueryBehavior.cjs.map +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +1 -3
- package/build/legacy/infiniteQueryBehavior.d.cts.map +1 -1
- package/build/legacy/infiniteQueryBehavior.d.ts +1 -3
- package/build/legacy/infiniteQueryBehavior.d.ts.map +1 -1
- package/build/legacy/infiniteQueryBehavior.js +4 -4
- package/build/legacy/infiniteQueryBehavior.js.map +1 -1
- package/build/legacy/infiniteQueryObserver.cjs +1 -2
- package/build/legacy/infiniteQueryObserver.d.cts +2 -4
- package/build/legacy/infiniteQueryObserver.d.cts.map +1 -1
- package/build/legacy/infiniteQueryObserver.d.ts +2 -4
- package/build/legacy/infiniteQueryObserver.d.ts.map +1 -1
- package/build/legacy/infiniteQueryObserver.js +1 -2
- package/build/legacy/mutation.cjs +4 -4
- package/build/legacy/mutation.cjs.map +1 -1
- package/build/legacy/mutation.d.cts +1 -1
- package/build/legacy/mutation.d.ts +1 -1
- package/build/legacy/mutation.js +4 -4
- package/build/legacy/mutation.js.map +1 -1
- package/build/legacy/mutationCache.cjs +2 -3
- package/build/legacy/mutationCache.d.cts +1 -1
- package/build/legacy/mutationCache.d.ts +1 -1
- package/build/legacy/mutationCache.js +2 -3
- package/build/legacy/mutationObserver.cjs +3 -4
- package/build/legacy/mutationObserver.d.cts +1 -1
- package/build/legacy/mutationObserver.d.ts +1 -1
- package/build/legacy/mutationObserver.js +3 -4
- package/build/legacy/notifyManager.cjs +1 -2
- package/build/legacy/notifyManager.cjs.map +1 -1
- package/build/legacy/notifyManager.d.cts +0 -2
- package/build/legacy/notifyManager.d.cts.map +1 -1
- package/build/legacy/notifyManager.d.ts +0 -2
- package/build/legacy/notifyManager.d.ts.map +1 -1
- package/build/legacy/notifyManager.js +1 -2
- package/build/legacy/onlineManager.cjs +2 -3
- package/build/legacy/onlineManager.d.cts +1 -3
- package/build/legacy/onlineManager.d.cts.map +1 -1
- package/build/legacy/onlineManager.d.ts +1 -3
- package/build/legacy/onlineManager.d.ts.map +1 -1
- package/build/legacy/onlineManager.js +2 -3
- package/build/legacy/queriesObserver.cjs +3 -4
- package/build/legacy/queriesObserver.d.cts +2 -4
- package/build/legacy/queriesObserver.d.cts.map +1 -1
- package/build/legacy/queriesObserver.d.ts +2 -4
- package/build/legacy/queriesObserver.d.ts.map +1 -1
- package/build/legacy/queriesObserver.js +3 -4
- package/build/legacy/query.cjs +57 -40
- package/build/legacy/query.cjs.map +1 -1
- package/build/legacy/query.d.cts +1 -1
- package/build/legacy/query.d.ts +1 -1
- package/build/legacy/query.js +58 -41
- package/build/legacy/query.js.map +1 -1
- package/build/legacy/queryCache.cjs +2 -3
- package/build/legacy/queryCache.d.cts +1 -1
- package/build/legacy/queryCache.d.ts +1 -1
- package/build/legacy/queryCache.js +2 -3
- package/build/legacy/queryClient.cjs +13 -9
- package/build/legacy/queryClient.cjs.map +1 -1
- package/build/legacy/queryClient.d.cts +1 -1
- package/build/legacy/queryClient.d.ts +1 -1
- package/build/legacy/queryClient.js +13 -9
- package/build/legacy/queryClient.js.map +1 -1
- package/build/legacy/queryObserver.cjs +6 -10
- package/build/legacy/queryObserver.cjs.map +1 -1
- package/build/legacy/queryObserver.d.cts +1 -1
- package/build/legacy/queryObserver.d.ts +1 -1
- package/build/legacy/queryObserver.js +6 -10
- package/build/legacy/queryObserver.js.map +1 -1
- package/build/{modern/removable-Cw9GNGyK.d.ts → legacy/removable-B1nFbgZm.d.cts} +1 -3
- package/build/legacy/removable-B1nFbgZm.d.cts.map +1 -0
- package/build/legacy/{removable-Cw9GNGyK.d.ts → removable-B1nFbgZm.d.ts} +1 -3
- package/build/legacy/removable-B1nFbgZm.d.ts.map +1 -0
- package/build/legacy/removable.cjs +2 -3
- package/build/legacy/removable.d.cts +1 -1
- package/build/legacy/removable.d.ts +1 -1
- package/build/legacy/removable.js +2 -3
- package/build/legacy/retryer.cjs +1 -2
- package/build/legacy/retryer.d.cts +1 -1
- package/build/legacy/retryer.d.ts +1 -1
- package/build/legacy/retryer.js +1 -2
- package/build/legacy/streamedQuery.cjs +11 -6
- package/build/legacy/streamedQuery.cjs.map +1 -1
- package/build/legacy/streamedQuery.d.cts +3 -3
- package/build/legacy/streamedQuery.d.cts.map +1 -1
- package/build/legacy/streamedQuery.d.ts +3 -3
- package/build/legacy/streamedQuery.d.ts.map +1 -1
- package/build/legacy/streamedQuery.js +12 -7
- package/build/legacy/streamedQuery.js.map +1 -1
- package/build/legacy/{subscribable-czlHOxMP.d.ts → subscribable-D2lAzdDi.d.cts} +1 -3
- package/build/legacy/subscribable-D2lAzdDi.d.cts.map +1 -0
- package/build/{modern/subscribable-czlHOxMP.d.ts → legacy/subscribable-D2lAzdDi.d.ts} +1 -3
- package/build/legacy/subscribable-D2lAzdDi.d.ts.map +1 -0
- package/build/legacy/subscribable.cjs +1 -2
- package/build/legacy/subscribable.d.cts +1 -1
- package/build/legacy/subscribable.d.ts +1 -1
- package/build/legacy/subscribable.js +1 -2
- package/build/legacy/timeoutManager.cjs +2 -3
- package/build/legacy/timeoutManager.d.cts +0 -2
- package/build/legacy/timeoutManager.d.cts.map +1 -1
- package/build/legacy/timeoutManager.d.ts +0 -2
- package/build/legacy/timeoutManager.d.ts.map +1 -1
- package/build/legacy/timeoutManager.js +2 -3
- package/build/legacy/types.cjs +1 -2
- package/build/legacy/types.d.cts +1 -1
- package/build/legacy/types.d.ts +1 -1
- package/build/legacy/types.js +1 -2
- package/build/legacy/utils.cjs +24 -21
- package/build/legacy/utils.cjs.map +1 -1
- package/build/legacy/utils.d.cts +2 -2
- package/build/legacy/utils.d.ts +2 -2
- package/build/legacy/utils.js +24 -22
- package/build/legacy/utils.js.map +1 -1
- package/build/modern/environmentManager.cjs +1 -2
- package/build/modern/environmentManager.d.cts +0 -2
- package/build/modern/environmentManager.d.cts.map +1 -1
- package/build/modern/environmentManager.d.ts +0 -2
- package/build/modern/environmentManager.d.ts.map +1 -1
- package/build/modern/environmentManager.js +1 -2
- package/build/modern/focusManager.cjs +1 -2
- package/build/modern/focusManager.d.cts +1 -3
- package/build/modern/focusManager.d.cts.map +1 -1
- package/build/modern/focusManager.d.ts +1 -3
- package/build/modern/focusManager.d.ts.map +1 -1
- package/build/modern/focusManager.js +1 -2
- package/build/modern/{hydration-DhAJ02bL.d.cts → hydration-BXjqUj_D.d.cts} +28 -39
- package/build/modern/hydration-BXjqUj_D.d.cts.map +1 -0
- package/build/{legacy/hydration-DhAJ02bL.d.cts → modern/hydration-vgIjIhk6.d.ts} +28 -39
- package/build/modern/hydration-vgIjIhk6.d.ts.map +1 -0
- package/build/modern/hydration.cjs +1 -2
- package/build/modern/hydration.d.cts +1 -1
- package/build/modern/hydration.d.ts +1 -1
- package/build/modern/hydration.js +1 -2
- package/build/modern/index.cjs +1 -2
- package/build/modern/index.d.cts +1 -1
- package/build/modern/index.d.ts +1 -1
- package/build/modern/index.js +1 -2
- package/build/modern/infiniteQueryBehavior.cjs +3 -3
- package/build/modern/infiniteQueryBehavior.cjs.map +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +1 -3
- package/build/modern/infiniteQueryBehavior.d.cts.map +1 -1
- package/build/modern/infiniteQueryBehavior.d.ts +1 -3
- package/build/modern/infiniteQueryBehavior.d.ts.map +1 -1
- package/build/modern/infiniteQueryBehavior.js +4 -4
- package/build/modern/infiniteQueryBehavior.js.map +1 -1
- package/build/modern/infiniteQueryObserver.cjs +1 -2
- package/build/modern/infiniteQueryObserver.d.cts +2 -4
- package/build/modern/infiniteQueryObserver.d.cts.map +1 -1
- package/build/modern/infiniteQueryObserver.d.ts +2 -4
- package/build/modern/infiniteQueryObserver.d.ts.map +1 -1
- package/build/modern/infiniteQueryObserver.js +1 -2
- package/build/modern/mutation.cjs +2 -2
- package/build/modern/mutation.cjs.map +1 -1
- package/build/modern/mutation.d.cts +1 -1
- package/build/modern/mutation.d.ts +1 -1
- package/build/modern/mutation.js +2 -2
- package/build/modern/mutation.js.map +1 -1
- package/build/modern/mutationCache.cjs +1 -2
- package/build/modern/mutationCache.d.cts +1 -1
- package/build/modern/mutationCache.d.ts +1 -1
- package/build/modern/mutationCache.js +1 -2
- package/build/modern/mutationObserver.cjs +1 -2
- package/build/modern/mutationObserver.d.cts +1 -1
- package/build/modern/mutationObserver.d.ts +1 -1
- package/build/modern/mutationObserver.js +1 -2
- package/build/modern/notifyManager.cjs +1 -2
- package/build/modern/notifyManager.cjs.map +1 -1
- package/build/modern/notifyManager.d.cts +0 -2
- package/build/modern/notifyManager.d.cts.map +1 -1
- package/build/modern/notifyManager.d.ts +0 -2
- package/build/modern/notifyManager.d.ts.map +1 -1
- package/build/modern/notifyManager.js +1 -2
- package/build/modern/onlineManager.cjs +1 -2
- package/build/modern/onlineManager.d.cts +1 -3
- package/build/modern/onlineManager.d.cts.map +1 -1
- package/build/modern/onlineManager.d.ts +1 -3
- package/build/modern/onlineManager.d.ts.map +1 -1
- package/build/modern/onlineManager.js +1 -2
- package/build/modern/queriesObserver.cjs +1 -2
- package/build/modern/queriesObserver.d.cts +2 -4
- package/build/modern/queriesObserver.d.cts.map +1 -1
- package/build/modern/queriesObserver.d.ts +2 -4
- package/build/modern/queriesObserver.d.ts.map +1 -1
- package/build/modern/queriesObserver.js +1 -2
- package/build/modern/query.cjs +52 -36
- package/build/modern/query.cjs.map +1 -1
- package/build/modern/query.d.cts +1 -1
- package/build/modern/query.d.ts +1 -1
- package/build/modern/query.js +53 -37
- package/build/modern/query.js.map +1 -1
- package/build/modern/queryCache.cjs +1 -2
- package/build/modern/queryCache.d.cts +1 -1
- package/build/modern/queryCache.d.ts +1 -1
- package/build/modern/queryCache.js +1 -2
- package/build/modern/queryClient.cjs +12 -8
- package/build/modern/queryClient.cjs.map +1 -1
- package/build/modern/queryClient.d.cts +1 -1
- package/build/modern/queryClient.d.ts +1 -1
- package/build/modern/queryClient.js +12 -8
- package/build/modern/queryClient.js.map +1 -1
- package/build/modern/queryObserver.cjs +4 -8
- package/build/modern/queryObserver.cjs.map +1 -1
- package/build/modern/queryObserver.d.cts +1 -1
- package/build/modern/queryObserver.d.ts +1 -1
- package/build/modern/queryObserver.js +4 -8
- package/build/modern/queryObserver.js.map +1 -1
- package/build/modern/{removable-Cw9GNGyK.d.cts → removable-B1nFbgZm.d.cts} +1 -3
- package/build/modern/removable-B1nFbgZm.d.cts.map +1 -0
- package/build/{legacy/removable-Cw9GNGyK.d.cts → modern/removable-B1nFbgZm.d.ts} +1 -3
- package/build/modern/removable-B1nFbgZm.d.ts.map +1 -0
- package/build/modern/removable.cjs +1 -2
- package/build/modern/removable.d.cts +1 -1
- package/build/modern/removable.d.ts +1 -1
- package/build/modern/removable.js +1 -2
- package/build/modern/retryer.cjs +1 -2
- package/build/modern/retryer.d.cts +1 -1
- package/build/modern/retryer.d.ts +1 -1
- package/build/modern/retryer.js +1 -2
- package/build/modern/streamedQuery.cjs +11 -6
- package/build/modern/streamedQuery.cjs.map +1 -1
- package/build/modern/streamedQuery.d.cts +3 -3
- package/build/modern/streamedQuery.d.cts.map +1 -1
- package/build/modern/streamedQuery.d.ts +3 -3
- package/build/modern/streamedQuery.d.ts.map +1 -1
- package/build/modern/streamedQuery.js +12 -7
- package/build/modern/streamedQuery.js.map +1 -1
- package/build/{legacy/subscribable-czlHOxMP.d.cts → modern/subscribable-D2lAzdDi.d.cts} +1 -3
- package/build/modern/subscribable-D2lAzdDi.d.cts.map +1 -0
- package/build/modern/{subscribable-czlHOxMP.d.cts → subscribable-D2lAzdDi.d.ts} +1 -3
- package/build/modern/subscribable-D2lAzdDi.d.ts.map +1 -0
- package/build/modern/subscribable.cjs +1 -2
- package/build/modern/subscribable.d.cts +1 -1
- package/build/modern/subscribable.d.ts +1 -1
- package/build/modern/subscribable.js +1 -2
- package/build/modern/timeoutManager.cjs +1 -2
- package/build/modern/timeoutManager.d.cts +0 -2
- package/build/modern/timeoutManager.d.cts.map +1 -1
- package/build/modern/timeoutManager.d.ts +0 -2
- package/build/modern/timeoutManager.d.ts.map +1 -1
- package/build/modern/timeoutManager.js +1 -2
- package/build/modern/types.cjs +1 -2
- package/build/modern/types.d.cts +1 -1
- package/build/modern/types.d.ts +1 -1
- package/build/modern/types.js +1 -2
- package/build/modern/utils.cjs +24 -21
- package/build/modern/utils.cjs.map +1 -1
- package/build/modern/utils.d.cts +2 -2
- package/build/modern/utils.d.ts +2 -2
- package/build/modern/utils.js +24 -22
- package/build/modern/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/infiniteQueryBehavior.ts +5 -1
- package/src/mutation.ts +4 -0
- package/src/query.ts +78 -64
- package/src/queryClient.ts +17 -13
- package/src/queryObserver.ts +14 -12
- package/src/streamedQuery.ts +14 -3
- package/src/utils.ts +39 -26
- package/build/legacy/hydration-CS3HS-a9.d.ts.map +0 -1
- package/build/legacy/hydration-DhAJ02bL.d.cts.map +0 -1
- package/build/legacy/removable-Cw9GNGyK.d.cts.map +0 -1
- package/build/legacy/removable-Cw9GNGyK.d.ts.map +0 -1
- package/build/legacy/subscribable-czlHOxMP.d.cts.map +0 -1
- package/build/legacy/subscribable-czlHOxMP.d.ts.map +0 -1
- package/build/modern/hydration-CS3HS-a9.d.ts.map +0 -1
- package/build/modern/hydration-DhAJ02bL.d.cts.map +0 -1
- package/build/modern/removable-Cw9GNGyK.d.cts.map +0 -1
- package/build/modern/removable-Cw9GNGyK.d.ts.map +0 -1
- package/build/modern/subscribable-czlHOxMP.d.cts.map +0 -1
- package/build/modern/subscribable-czlHOxMP.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Jn as MutationCacheNotifyEvent, Kn as MutationCache, qn as MutationCacheConfig } from "./hydration-BXjqUj_D.cjs";
|
|
2
2
|
export { MutationCache, MutationCacheConfig, MutationCacheNotifyEvent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Jn as MutationCacheNotifyEvent, Kn as MutationCache, qn as MutationCacheConfig } from "./hydration-vgIjIhk6.js";
|
|
2
2
|
export { MutationCache, MutationCacheConfig, MutationCacheNotifyEvent };
|
|
@@ -2,7 +2,7 @@ import { matchMutation, noop } from "./utils.js";
|
|
|
2
2
|
import { Subscribable } from "./subscribable.js";
|
|
3
3
|
import { notifyManager } from "./notifyManager.js";
|
|
4
4
|
import { Mutation } from "./mutation.js";
|
|
5
|
-
|
|
5
|
+
// src/mutationCache.ts
|
|
6
6
|
/**
|
|
7
7
|
* The `MutationCache` is the storage for mutations.
|
|
8
8
|
*
|
|
@@ -224,7 +224,6 @@ var MutationCache = class extends Subscribable {
|
|
|
224
224
|
function scopeFor(mutation) {
|
|
225
225
|
return mutation.options.scope?.id;
|
|
226
226
|
}
|
|
227
|
-
//#endregion
|
|
228
227
|
export { MutationCache };
|
|
229
228
|
|
|
230
229
|
//# sourceMappingURL=mutationCache.js.map
|
|
@@ -3,7 +3,7 @@ const require_utils = require("./utils.cjs");
|
|
|
3
3
|
const require_subscribable = require("./subscribable.cjs");
|
|
4
4
|
const require_notifyManager = require("./notifyManager.cjs");
|
|
5
5
|
const require_mutation = require("./mutation.cjs");
|
|
6
|
-
|
|
6
|
+
// src/mutationObserver.ts
|
|
7
7
|
/**
|
|
8
8
|
* Observes a single mutation and derives a `MutationObserverResult` from it.
|
|
9
9
|
* A framework hook like `useMutation` creates one `MutationObserver` per hook
|
|
@@ -194,7 +194,6 @@ var MutationObserver = class extends require_subscribable.Subscribable {
|
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
|
-
//#endregion
|
|
198
197
|
exports.MutationObserver = MutationObserver;
|
|
199
198
|
|
|
200
199
|
//# sourceMappingURL=mutationObserver.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Yn as MutationObserver } from "./hydration-BXjqUj_D.cjs";
|
|
2
2
|
export { MutationObserver };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Yn as MutationObserver } from "./hydration-vgIjIhk6.js";
|
|
2
2
|
export { MutationObserver };
|
|
@@ -2,7 +2,7 @@ import { hashKey, shallowEqualObjects } from "./utils.js";
|
|
|
2
2
|
import { Subscribable } from "./subscribable.js";
|
|
3
3
|
import { notifyManager } from "./notifyManager.js";
|
|
4
4
|
import { getDefaultState } from "./mutation.js";
|
|
5
|
-
|
|
5
|
+
// src/mutationObserver.ts
|
|
6
6
|
/**
|
|
7
7
|
* Observes a single mutation and derives a `MutationObserverResult` from it.
|
|
8
8
|
* A framework hook like `useMutation` creates one `MutationObserver` per hook
|
|
@@ -193,7 +193,6 @@ var MutationObserver = class extends Subscribable {
|
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
|
-
//#endregion
|
|
197
196
|
export { MutationObserver };
|
|
198
197
|
|
|
199
198
|
//# sourceMappingURL=mutationObserver.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/notifyManager.ts
|
|
3
3
|
/**
|
|
4
4
|
* Default scheduling function used by the notify manager.
|
|
5
5
|
* Schedules the callback with the system's `setTimeout(callback, 0)`.
|
|
@@ -125,7 +125,6 @@ function createNotifyManager() {
|
|
|
125
125
|
* Handles scheduling and batching callbacks in TanStack Query.
|
|
126
126
|
*/
|
|
127
127
|
const notifyManager = createNotifyManager();
|
|
128
|
-
//#endregion
|
|
129
128
|
exports.createNotifyManager = createNotifyManager;
|
|
130
129
|
exports.defaultScheduler = defaultScheduler;
|
|
131
130
|
exports.notifyManager = notifyManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifyManager.cjs","names":["systemSetTimeoutZero"],"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\nimport { systemSetTimeoutZero } from './timeoutManager'\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\n/**\n * Default scheduling function used by the notify manager.\n * Schedules the callback with the system's `setTimeout(callback, 0)`.\n */\nexport const defaultScheduler: ScheduleFunction = systemSetTimeoutZero\n\n/**\n * Creates a notify manager, which schedules and batches notifications to subscribers. Query uses a\n * single instance of it, exported as {@link notifyManager}.\n * @returns A new notify manager.\n */\nexport function createNotifyManager() {\n let queue: Array<NotifyCallback> = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n /**\n * Batches all updates scheduled inside the passed callback.\n * This is mainly used internally to optimize query client updating.\n * Batches can be nested; the queue is only flushed once the outermost `batch` call finishes.\n * The return value of `callback` is passed through.\n * @param callback - The function to run in the batch.\n * @returns The return value of `callback`.\n */\n batch: <T>(callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n * @param callback - The function to wrap.\n * @returns A function that schedules a call to `callback` with the given arguments.\n */\n batchCalls: <T extends Array<unknown>>(\n callback: BatchCallsCallback<T>,\n ): BatchCallsCallback<T> => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n /**\n * Schedules a function to be run on the next batch.\n * By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`.\n */\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n * @param fn - Receives each notification callback and must call it.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * Framework adapters use this to plug in their own batching primitive, so that a single query\n * update only triggers one re-render instead of one per subscriber.\n * @param fn - Receives a function that runs a batch of notifications and must call it.\n * @example\n * ```ts\n * import { notifyManager } from '@tanstack/query-core'\n * import { batch } from 'solid-js'\n *\n * notifyManager.setBatchNotifyFunction(batch)\n * ```\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n /**\n * Configures a custom callback that schedules when the next batch runs.\n * The default behavior is `setTimeout(callback, 0)`.\n * @param fn - Receives a callback that runs the next batch, and schedules it.\n * @example\n * ```ts\n * import { notifyManager } from '@tanstack/query-core'\n *\n * // Schedule batches in the next microtask\n * notifyManager.setScheduler(queueMicrotask)\n *\n * // Schedule batches before the next frame is rendered\n * notifyManager.setScheduler(requestAnimationFrame)\n *\n * // Schedule batches some time in the future\n * notifyManager.setScheduler((cb) => setTimeout(cb, 10))\n * ```\n */\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\n\n/**\n * Handles scheduling and batching callbacks in TanStack Query.\n */\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;;;;AAkBA,MAAa,
|
|
1
|
+
{"version":3,"file":"notifyManager.cjs","names":["systemSetTimeoutZero"],"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\nimport { systemSetTimeoutZero } from './timeoutManager'\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\n/**\n * Default scheduling function used by the notify manager.\n * Schedules the callback with the system's `setTimeout(callback, 0)`.\n */\nexport const defaultScheduler: ScheduleFunction = systemSetTimeoutZero\n\n/**\n * Creates a notify manager, which schedules and batches notifications to subscribers. Query uses a\n * single instance of it, exported as {@link notifyManager}.\n * @returns A new notify manager.\n */\nexport function createNotifyManager() {\n let queue: Array<NotifyCallback> = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n /**\n * Batches all updates scheduled inside the passed callback.\n * This is mainly used internally to optimize query client updating.\n * Batches can be nested; the queue is only flushed once the outermost `batch` call finishes.\n * The return value of `callback` is passed through.\n * @param callback - The function to run in the batch.\n * @returns The return value of `callback`.\n */\n batch: <T>(callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n * @param callback - The function to wrap.\n * @returns A function that schedules a call to `callback` with the given arguments.\n */\n batchCalls: <T extends Array<unknown>>(\n callback: BatchCallsCallback<T>,\n ): BatchCallsCallback<T> => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n /**\n * Schedules a function to be run on the next batch.\n * By default, the batch is run with a `setTimeout`, but this can be configured via `setScheduler`.\n */\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n * @param fn - Receives each notification callback and must call it.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * Framework adapters use this to plug in their own batching primitive, so that a single query\n * update only triggers one re-render instead of one per subscriber.\n * @param fn - Receives a function that runs a batch of notifications and must call it.\n * @example\n * ```ts\n * import { notifyManager } from '@tanstack/query-core'\n * import { batch } from 'solid-js'\n *\n * notifyManager.setBatchNotifyFunction(batch)\n * ```\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n /**\n * Configures a custom callback that schedules when the next batch runs.\n * The default behavior is `setTimeout(callback, 0)`.\n * @param fn - Receives a callback that runs the next batch, and schedules it.\n * @example\n * ```ts\n * import { notifyManager } from '@tanstack/query-core'\n *\n * // Schedule batches in the next microtask\n * notifyManager.setScheduler(queueMicrotask)\n *\n * // Schedule batches before the next frame is rendered\n * notifyManager.setScheduler(requestAnimationFrame)\n *\n * // Schedule batches some time in the future\n * notifyManager.setScheduler((cb) => setTimeout(cb, 10))\n * ```\n */\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\n\n/**\n * Handles scheduling and batching callbacks in TanStack Query.\n */\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;;;;AAkBA,MAAa,mB,8BAAqCA,CAAAA,CAAAA;;;;;;AAOlD,SAAgB,sBAAsB;CACpC,IAAI,QAA+B,CAAC;CACpC,IAAI,eAAe;CACnB,IAAI,YAA4B,aAAa;EAC3C,SAAS;CACX;CACA,IAAI,iBAAsC,aAAyB;EACjE,SAAS;CACX;CACA,IAAI,aAAa;CAEjB,MAAM,YAAY,aAAmC;EACnD,IAAI,cACF,MAAM,KAAK,QAAQ;OAEnB,iBAAiB;GACf,SAAS,QAAQ;EACnB,CAAC;CAEL;CACA,MAAM,cAAoB;EACxB,MAAM,gBAAgB;EACtB,QAAQ,CAAC;EACT,IAAI,cAAc,QAChB,iBAAiB;GACf,oBAAoB;IAClB,cAAc,SAAS,aAAa;KAClC,SAAS,QAAQ;IACnB,CAAC;GACH,CAAC;EACH,CAAC;CAEL;CAEA,OAAO;;;;;;;;;EASL,QAAW,aAAyB;GAClC,IAAI;GACJ;GACA,IAAI;IACF,SAAS,SAAS;GACpB,UAAU;IACR;IACA,IAAI,CAAC,cACH,MAAM;GAEV;GACA,OAAO;EACT;;;;;;EAMA,aACE,aAC0B;GAC1B,QAAQ,GAAG,SAAS;IAClB,eAAe;KACb,SAAS,GAAG,IAAI;IAClB,CAAC;GACH;EACF;;;;;EAKA;;;;;;EAMA,oBAAoB,OAAuB;GACzC,WAAW;EACb;;;;;;;;;;;;;;EAcA,yBAAyB,OAA4B;GACnD,gBAAgB;EAClB;;;;;;;;;;;;;;;;;;;EAmBA,eAAe,OAAyB;GACtC,aAAa;EACf;CACF;AACF;;;;AAOA,MAAa,gBAAgB,oBAAoB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/notifyManager.d.ts
|
|
2
1
|
type NotifyCallback = () => void;
|
|
3
2
|
type NotifyFunction = (callback: () => void) => void;
|
|
4
3
|
type BatchNotifyFunction = (callback: () => void) => void;
|
|
@@ -139,5 +138,4 @@ export declare const notifyManager: {
|
|
|
139
138
|
*/
|
|
140
139
|
readonly setScheduler: (fn: ScheduleFunction) => void;
|
|
141
140
|
};
|
|
142
|
-
//#endregion
|
|
143
141
|
//# sourceMappingURL=notifyManager.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifyManager.d.cts","names":[],"sources":["../../src/notifyManager.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"notifyManager.d.cts","names":[],"sources":["../../src/notifyManager.ts"],"mappings":"A,KAIK;KAEA,kBAAkB;KAElB,uBAAuB;KAEvB,mBAAmB,UAAU,sBAAsB,MAAM;KAEzD,oBAAoB;;;;;qBAMZ,kBAAkB;;;;;;wBAOf;;;;;;;;;WA2CJ,QAAA,GAAC,gBAAkB,MAAI;;;;;;WAkBlB,aAAA,UAAU,gBAAc,UACzB,mBAAmB,OAC5B,mBAAmB;;;;;WApDI,WAAA,UAAA;;;;;;WAqEF,oBAAA,IAAA;;;;;;;;;;;;;;WAgBK,yBAAA,IAAA;;;;;;;;;;;;;;;;;;;WAqBV,eAAA,IAAA;;;;;qBAWV;;;;;;;;;WArFD,QAAA,GAAC,gBAAkB,MAAI;;;;;;WAkBlB,aAAA,UAAU,gBAAc,UACzB,mBAAmB,OAC5B,mBAAmB;;;;;WApDI,WAAA,UAAA;;;;;;WAqEF,oBAAA,IAAA;;;;;;;;;;;;;;WAgBK,yBAAA,IAAA;;;;;;;;;;;;;;;;;;;WAqBV,eAAA,IAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/notifyManager.d.ts
|
|
2
1
|
type NotifyCallback = () => void;
|
|
3
2
|
type NotifyFunction = (callback: () => void) => void;
|
|
4
3
|
type BatchNotifyFunction = (callback: () => void) => void;
|
|
@@ -139,5 +138,4 @@ export declare const notifyManager: {
|
|
|
139
138
|
*/
|
|
140
139
|
readonly setScheduler: (fn: ScheduleFunction) => void;
|
|
141
140
|
};
|
|
142
|
-
//#endregion
|
|
143
141
|
//# sourceMappingURL=notifyManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifyManager.d.ts","names":[],"sources":["../../src/notifyManager.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"notifyManager.d.ts","names":[],"sources":["../../src/notifyManager.ts"],"mappings":"A,KAIK;KAEA,kBAAkB;KAElB,uBAAuB;KAEvB,mBAAmB,UAAU,sBAAsB,MAAM;KAEzD,oBAAoB;;;;;qBAMZ,kBAAkB;;;;;;wBAOf;;;;;;;;;WA2CJ,QAAA,GAAC,gBAAkB,MAAI;;;;;;WAkBlB,aAAA,UAAU,gBAAc,UACzB,mBAAmB,OAC5B,mBAAmB;;;;;WApDI,WAAA,UAAA;;;;;;WAqEF,oBAAA,IAAA;;;;;;;;;;;;;;WAgBK,yBAAA,IAAA;;;;;;;;;;;;;;;;;;;WAqBV,eAAA,IAAA;;;;;qBAWV;;;;;;;;;WArFD,QAAA,GAAC,gBAAkB,MAAI;;;;;;WAkBlB,aAAA,UAAU,gBAAc,UACzB,mBAAmB,OAC5B,mBAAmB;;;;;WApDI,WAAA,UAAA;;;;;;WAqEF,oBAAA,IAAA;;;;;;;;;;;;;;WAgBK,yBAAA,IAAA;;;;;;;;;;;;;;;;;;;WAqBV,eAAA,IAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { systemSetTimeoutZero } from "./timeoutManager.js";
|
|
2
|
-
|
|
2
|
+
// src/notifyManager.ts
|
|
3
3
|
/**
|
|
4
4
|
* Default scheduling function used by the notify manager.
|
|
5
5
|
* Schedules the callback with the system's `setTimeout(callback, 0)`.
|
|
@@ -125,7 +125,6 @@ function createNotifyManager() {
|
|
|
125
125
|
* Handles scheduling and batching callbacks in TanStack Query.
|
|
126
126
|
*/
|
|
127
127
|
const notifyManager = createNotifyManager();
|
|
128
|
-
//#endregion
|
|
129
128
|
export { createNotifyManager, defaultScheduler, notifyManager };
|
|
130
129
|
|
|
131
130
|
//# sourceMappingURL=notifyManager.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_subscribable = require("./subscribable.cjs");
|
|
3
|
-
|
|
3
|
+
// src/onlineManager.ts
|
|
4
4
|
/**
|
|
5
5
|
* The `OnlineManager` manages the online state within TanStack Query. It can
|
|
6
6
|
* be used to change the default event listeners or to manually change the
|
|
@@ -96,7 +96,6 @@ var OnlineManager = class extends require_subscribable.Subscribable {
|
|
|
96
96
|
* Singleton instance of {@link OnlineManager}, used to manage and observe the online state within TanStack Query.
|
|
97
97
|
*/
|
|
98
98
|
const onlineManager = new OnlineManager();
|
|
99
|
-
//#endregion
|
|
100
99
|
exports.OnlineManager = OnlineManager;
|
|
101
100
|
exports.onlineManager = onlineManager;
|
|
102
101
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as Subscribable } from "./subscribable-
|
|
2
|
-
//#region src/onlineManager.d.ts
|
|
1
|
+
import { t as Subscribable } from "./subscribable-D2lAzdDi.cjs";
|
|
3
2
|
type Listener = (online: boolean) => void;
|
|
4
3
|
type SetupFn = (setOnline: Listener) => (() => void) | undefined;
|
|
5
4
|
/**
|
|
@@ -61,5 +60,4 @@ export declare class OnlineManager extends Subscribable<Listener> {
|
|
|
61
60
|
* Singleton instance of {@link OnlineManager}, used to manage and observe the online state within TanStack Query.
|
|
62
61
|
*/
|
|
63
62
|
export declare const onlineManager: OnlineManager;
|
|
64
|
-
//#endregion
|
|
65
63
|
//# sourceMappingURL=onlineManager.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onlineManager.d.cts","names":[],"sources":["../../src/onlineManager.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"onlineManager.d.cts","names":[],"sources":["../../src/onlineManager.ts"],"mappings":";KAEK,YAAY;KACZ,WAAW,WAAW;;;;;;;;;;qBAWd,sBAAsB,aAAa;;;YA6B3B;YAMA;;;;;;;;;;;;;;;;;;;;EA0BnB,iBAAiB,OAAO;;;;;;;;;;;;;;;EAoBxB,UAAU;;;;;EAeV;;;;;qBAQW,eAAa"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as Subscribable } from "./subscribable-
|
|
2
|
-
//#region src/onlineManager.d.ts
|
|
1
|
+
import { t as Subscribable } from "./subscribable-D2lAzdDi.js";
|
|
3
2
|
type Listener = (online: boolean) => void;
|
|
4
3
|
type SetupFn = (setOnline: Listener) => (() => void) | undefined;
|
|
5
4
|
/**
|
|
@@ -61,5 +60,4 @@ export declare class OnlineManager extends Subscribable<Listener> {
|
|
|
61
60
|
* Singleton instance of {@link OnlineManager}, used to manage and observe the online state within TanStack Query.
|
|
62
61
|
*/
|
|
63
62
|
export declare const onlineManager: OnlineManager;
|
|
64
|
-
//#endregion
|
|
65
63
|
//# sourceMappingURL=onlineManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onlineManager.d.ts","names":[],"sources":["../../src/onlineManager.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"onlineManager.d.ts","names":[],"sources":["../../src/onlineManager.ts"],"mappings":";KAEK,YAAY;KACZ,WAAW,WAAW;;;;;;;;;;qBAWd,sBAAsB,aAAa;;;YA6B3B;YAMA;;;;;;;;;;;;;;;;;;;;EA0BnB,iBAAiB,OAAO;;;;;;;;;;;;;;;EAoBxB,UAAU;;;;;EAeV;;;;;qBAQW,eAAa"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Subscribable } from "./subscribable.js";
|
|
2
|
-
|
|
2
|
+
// src/onlineManager.ts
|
|
3
3
|
/**
|
|
4
4
|
* The `OnlineManager` manages the online state within TanStack Query. It can
|
|
5
5
|
* be used to change the default event listeners or to manually change the
|
|
@@ -95,7 +95,6 @@ var OnlineManager = class extends Subscribable {
|
|
|
95
95
|
* Singleton instance of {@link OnlineManager}, used to manage and observe the online state within TanStack Query.
|
|
96
96
|
*/
|
|
97
97
|
const onlineManager = new OnlineManager();
|
|
98
|
-
//#endregion
|
|
99
98
|
export { OnlineManager, onlineManager };
|
|
100
99
|
|
|
101
100
|
//# sourceMappingURL=onlineManager.js.map
|
|
@@ -3,7 +3,7 @@ const require_utils = require("./utils.cjs");
|
|
|
3
3
|
const require_subscribable = require("./subscribable.cjs");
|
|
4
4
|
const require_notifyManager = require("./notifyManager.cjs");
|
|
5
5
|
const require_queryObserver = require("./queryObserver.cjs");
|
|
6
|
-
|
|
6
|
+
// src/queriesObserver.ts
|
|
7
7
|
/**
|
|
8
8
|
* Returns the items of `array1` that are not in `array2`.
|
|
9
9
|
* @param array1 - The items to filter.
|
|
@@ -257,7 +257,6 @@ var QueriesObserver = class extends require_subscribable.Subscribable {
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
};
|
|
260
|
-
//#endregion
|
|
261
260
|
exports.QueriesObserver = QueriesObserver;
|
|
262
261
|
|
|
263
262
|
//# sourceMappingURL=queriesObserver.cjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as Subscribable } from "./subscribable-
|
|
2
|
-
import {
|
|
3
|
-
//#region src/queriesObserver.d.ts
|
|
1
|
+
import { t as Subscribable } from "./subscribable-D2lAzdDi.cjs";
|
|
2
|
+
import { At as QueryObserverOptions, Pt as QueryObserverResult, ar as QueryObserver, on as QueryClient, tr as Query } from "./hydration-BXjqUj_D.cjs";
|
|
4
3
|
type QueriesObserverListener = (result: Array<QueryObserverResult>) => void;
|
|
5
4
|
type CombineFn<TCombinedResult> = (result: Array<QueryObserverResult>) => TCombinedResult;
|
|
6
5
|
/**
|
|
@@ -99,5 +98,4 @@ export declare class QueriesObserver<TCombinedResult = Array<QueryObserverResult
|
|
|
99
98
|
*/
|
|
100
99
|
getOptimisticResult(queries: Array<QueryObserverOptions>, combine: CombineFn<TCombinedResult> | undefined): [rawResult: Array<QueryObserverResult>, combineResult: (r?: Array<QueryObserverResult>) => TCombinedResult, trackResult: () => Array<QueryObserverResult>];
|
|
101
100
|
}
|
|
102
|
-
//#endregion
|
|
103
101
|
//# sourceMappingURL=queriesObserver.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queriesObserver.d.cts","names":["_$__query0.Query"],"sources":["../../src/queriesObserver.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"queriesObserver.d.cts","names":["_$__query0.Query"],"sources":["../../src/queriesObserver.ts"],"mappings":";;KAsBK,2BAA2B,QAAQ,MAAM;KAEzC,UAAU,oBACb,QAAQ,MAAM,yBACX;;;;iBAKY,uBACf,kBAAkB,MAAM;;;;;;;;;EAUxB,UAAU,UAAU;;;;;;;;;;;;;;;;;;;;qBAqBT,gBACX,kBAAkB,MAAM,8BAChB,aAAa;;EAanB,YAAA,QAAQ,aACR,SAAS,MAAM,gDACf,UAAU,uBAAuB;YAahB;YAUA;;;;;EAUnB;;;;;;;;;;;;;;;;EAsBA,WACE,SAAS,MAAM,uBACf,UAAU,uBAAuB;;;;;;;;;;;;EAiFnC,oBAAoB,MAAM;;;;;;EAS1B,cAAUA,eAAA;;;;;;;EAUV,gBAAY,uBAAA;;;;;;;;;;;;EAeZ,oBACE,SAAS,MAAM,uBACf,SAAS,UAAU,gCAEnB,WAAW,MAAM,sBACjB,gBAAgB,IAAI,MAAM,yBAAyB,iBACnD,mBAAmB,MAAM"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as Subscribable } from "./subscribable-
|
|
2
|
-
import {
|
|
3
|
-
//#region src/queriesObserver.d.ts
|
|
1
|
+
import { t as Subscribable } from "./subscribable-D2lAzdDi.js";
|
|
2
|
+
import { At as QueryObserverOptions, Pt as QueryObserverResult, ar as QueryObserver, on as QueryClient, tr as Query } from "./hydration-vgIjIhk6.js";
|
|
4
3
|
type QueriesObserverListener = (result: Array<QueryObserverResult>) => void;
|
|
5
4
|
type CombineFn<TCombinedResult> = (result: Array<QueryObserverResult>) => TCombinedResult;
|
|
6
5
|
/**
|
|
@@ -99,5 +98,4 @@ export declare class QueriesObserver<TCombinedResult = Array<QueryObserverResult
|
|
|
99
98
|
*/
|
|
100
99
|
getOptimisticResult(queries: Array<QueryObserverOptions>, combine: CombineFn<TCombinedResult> | undefined): [rawResult: Array<QueryObserverResult>, combineResult: (r?: Array<QueryObserverResult>) => TCombinedResult, trackResult: () => Array<QueryObserverResult>];
|
|
101
100
|
}
|
|
102
|
-
//#endregion
|
|
103
101
|
//# sourceMappingURL=queriesObserver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queriesObserver.d.ts","names":["_$__query0.Query"],"sources":["../../src/queriesObserver.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"queriesObserver.d.ts","names":["_$__query0.Query"],"sources":["../../src/queriesObserver.ts"],"mappings":";;KAsBK,2BAA2B,QAAQ,MAAM;KAEzC,UAAU,oBACb,QAAQ,MAAM,yBACX;;;;iBAKY,uBACf,kBAAkB,MAAM;;;;;;;;;EAUxB,UAAU,UAAU;;;;;;;;;;;;;;;;;;;;qBAqBT,gBACX,kBAAkB,MAAM,8BAChB,aAAa;;EAanB,YAAA,QAAQ,aACR,SAAS,MAAM,gDACf,UAAU,uBAAuB;YAahB;YAUA;;;;;EAUnB;;;;;;;;;;;;;;;;EAsBA,WACE,SAAS,MAAM,uBACf,UAAU,uBAAuB;;;;;;;;;;;;EAiFnC,oBAAoB,MAAM;;;;;;EAS1B,cAAUA,eAAA;;;;;;;EAUV,gBAAY,uBAAA;;;;;;;;;;;;EAeZ,oBACE,SAAS,MAAM,uBACf,SAAS,UAAU,gCAEnB,WAAW,MAAM,sBACjB,gBAAgB,IAAI,MAAM,yBAAyB,iBACnD,mBAAmB,MAAM"}
|
|
@@ -2,7 +2,7 @@ import { replaceEqualDeep, shallowEqualObjects } from "./utils.js";
|
|
|
2
2
|
import { Subscribable } from "./subscribable.js";
|
|
3
3
|
import { notifyManager } from "./notifyManager.js";
|
|
4
4
|
import { QueryObserver } from "./queryObserver.js";
|
|
5
|
-
|
|
5
|
+
// src/queriesObserver.ts
|
|
6
6
|
/**
|
|
7
7
|
* Returns the items of `array1` that are not in `array2`.
|
|
8
8
|
* @param array1 - The items to filter.
|
|
@@ -256,7 +256,6 @@ var QueriesObserver = class extends Subscribable {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
|
-
//#endregion
|
|
260
259
|
export { QueriesObserver };
|
|
261
260
|
|
|
262
261
|
//# sourceMappingURL=queriesObserver.js.map
|
package/build/modern/query.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const require_notifyManager = require("./notifyManager.cjs");
|
|
|
4
4
|
const require_retryer = require("./retryer.cjs");
|
|
5
5
|
const require_removable = require("./removable.cjs");
|
|
6
6
|
const require_infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs");
|
|
7
|
-
|
|
7
|
+
// src/query.ts
|
|
8
8
|
/**
|
|
9
9
|
* Represents a single cached query. A `Query` holds the query's key, options,
|
|
10
10
|
* state (data/error/status), and the observers currently subscribed to it.
|
|
@@ -30,6 +30,7 @@ var Query = class extends require_removable.Removable {
|
|
|
30
30
|
#cache;
|
|
31
31
|
#client;
|
|
32
32
|
#retryer;
|
|
33
|
+
#fetchPromise;
|
|
33
34
|
#defaultOptions;
|
|
34
35
|
#abortSignalConsumed;
|
|
35
36
|
constructor(config) {
|
|
@@ -352,9 +353,9 @@ var Query = class extends require_removable.Removable {
|
|
|
352
353
|
async fetch(options, fetchOptions) {
|
|
353
354
|
if (this.state.fetchStatus !== "idle" && this.#retryer?.status() !== "rejected") {
|
|
354
355
|
if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) this.cancel({ silent: true });
|
|
355
|
-
else if (this.#retryer) {
|
|
356
|
+
else if (this.#retryer && this.#fetchPromise) {
|
|
356
357
|
this.#retryer.continueRetry();
|
|
357
|
-
return this.#
|
|
358
|
+
return this.#fetchPromise;
|
|
358
359
|
}
|
|
359
360
|
}
|
|
360
361
|
if (options) this.setOptions(options);
|
|
@@ -367,11 +368,17 @@ var Query = class extends require_removable.Removable {
|
|
|
367
368
|
}
|
|
368
369
|
const abortController = new AbortController();
|
|
369
370
|
const addSignalProperty = (object) => {
|
|
370
|
-
Object.
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
371
|
+
Object.defineProperties(object, {
|
|
372
|
+
[require_utils.fetchSignal]: {
|
|
373
|
+
value: abortController.signal,
|
|
374
|
+
enumerable: true
|
|
375
|
+
},
|
|
376
|
+
signal: {
|
|
377
|
+
enumerable: true,
|
|
378
|
+
get: () => {
|
|
379
|
+
this.#abortSignalConsumed = true;
|
|
380
|
+
return abortController.signal;
|
|
381
|
+
}
|
|
375
382
|
}
|
|
376
383
|
});
|
|
377
384
|
};
|
|
@@ -438,35 +445,45 @@ var Query = class extends require_removable.Removable {
|
|
|
438
445
|
networkMode: context.options.networkMode,
|
|
439
446
|
canRun: () => true
|
|
440
447
|
});
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
if (
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
if (error.
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
448
|
+
const fetchPromise = (async () => {
|
|
449
|
+
try {
|
|
450
|
+
const data = await retryer.promise;
|
|
451
|
+
if (data === void 0) {
|
|
452
|
+
if (process.env.NODE_ENV !== "production") console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`);
|
|
453
|
+
throw new Error(`${this.queryHash} data is undefined`);
|
|
454
|
+
}
|
|
455
|
+
this.setData(data);
|
|
456
|
+
this.#cache.config.onSuccess?.(data, this);
|
|
457
|
+
this.#cache.config.onSettled?.(data, this.state.error, this);
|
|
458
|
+
return data;
|
|
459
|
+
} catch (error) {
|
|
460
|
+
if (error instanceof require_retryer.CancelledError) {
|
|
461
|
+
if (error.silent) {
|
|
462
|
+
if (this.#retryer !== retryer && this.#fetchPromise) return this.#fetchPromise;
|
|
463
|
+
throw error;
|
|
464
|
+
} else if (error.revert) {
|
|
465
|
+
if (this.state.data === void 0) throw error;
|
|
466
|
+
return this.state.data;
|
|
467
|
+
}
|
|
457
468
|
}
|
|
469
|
+
this.#dispatch({
|
|
470
|
+
type: "error",
|
|
471
|
+
error
|
|
472
|
+
});
|
|
473
|
+
this.#cache.config.onError?.(error, this);
|
|
474
|
+
this.#cache.config.onSettled?.(this.state.data, error, this);
|
|
475
|
+
throw error;
|
|
476
|
+
} finally {
|
|
477
|
+
if (this.#retryer === retryer) {
|
|
478
|
+
this.#retryer = void 0;
|
|
479
|
+
this.#fetchPromise = void 0;
|
|
480
|
+
}
|
|
481
|
+
this.scheduleGc();
|
|
458
482
|
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
this.#cache.config.onError?.(error, this);
|
|
464
|
-
this.#cache.config.onSettled?.(this.state.data, error, this);
|
|
465
|
-
throw error;
|
|
466
|
-
} finally {
|
|
467
|
-
if (this.#retryer === retryer) this.#retryer = void 0;
|
|
468
|
-
this.scheduleGc();
|
|
469
|
-
}
|
|
483
|
+
})();
|
|
484
|
+
this.#fetchPromise = fetchPromise;
|
|
485
|
+
retryer.start();
|
|
486
|
+
return fetchPromise;
|
|
470
487
|
}
|
|
471
488
|
#dispatch(action) {
|
|
472
489
|
const reducer = (state) => {
|
|
@@ -597,7 +614,6 @@ function getDefaultState(options) {
|
|
|
597
614
|
fetchStatus: "idle"
|
|
598
615
|
};
|
|
599
616
|
}
|
|
600
|
-
//#endregion
|
|
601
617
|
exports.Query = Query;
|
|
602
618
|
exports.fetchState = fetchState;
|
|
603
619
|
|