@tanstack/query-core 5.103.3 → 5.104.0
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/environmentManager.d.cts +3 -4
- package/build/legacy/environmentManager.d.cts.map +1 -1
- package/build/legacy/environmentManager.d.ts +3 -4
- package/build/legacy/environmentManager.d.ts.map +1 -1
- package/build/legacy/focusManager.d.cts +2 -3
- package/build/legacy/focusManager.d.cts.map +1 -1
- package/build/legacy/focusManager.d.ts +2 -3
- package/build/legacy/focusManager.d.ts.map +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +3 -4
- package/build/legacy/infiniteQueryBehavior.d.cts.map +1 -1
- package/build/legacy/infiniteQueryBehavior.d.ts +3 -4
- package/build/legacy/infiniteQueryBehavior.d.ts.map +1 -1
- package/build/legacy/infiniteQueryObserver.d.cts +1 -2
- package/build/legacy/infiniteQueryObserver.d.cts.map +1 -1
- package/build/legacy/infiniteQueryObserver.d.ts +1 -2
- package/build/legacy/infiniteQueryObserver.d.ts.map +1 -1
- package/build/legacy/notifyManager.d.cts +3 -4
- package/build/legacy/notifyManager.d.cts.map +1 -1
- package/build/legacy/notifyManager.d.ts +3 -4
- package/build/legacy/notifyManager.d.ts.map +1 -1
- package/build/legacy/onlineManager.d.cts +2 -3
- package/build/legacy/onlineManager.d.cts.map +1 -1
- package/build/legacy/onlineManager.d.ts +2 -3
- package/build/legacy/onlineManager.d.ts.map +1 -1
- package/build/legacy/queriesObserver.d.cts +2 -3
- package/build/legacy/queriesObserver.d.cts.map +1 -1
- package/build/legacy/queriesObserver.d.ts +2 -3
- package/build/legacy/queriesObserver.d.ts.map +1 -1
- package/build/legacy/streamedQuery.cjs.map +1 -1
- package/build/legacy/streamedQuery.d.cts +1 -2
- package/build/legacy/streamedQuery.d.cts.map +1 -1
- package/build/legacy/streamedQuery.d.ts +1 -2
- package/build/legacy/streamedQuery.d.ts.map +1 -1
- package/build/legacy/streamedQuery.js.map +1 -1
- package/build/legacy/timeoutManager.d.cts +7 -8
- package/build/legacy/timeoutManager.d.cts.map +1 -1
- package/build/legacy/timeoutManager.d.ts +7 -8
- package/build/legacy/timeoutManager.d.ts.map +1 -1
- package/build/modern/environmentManager.d.cts +3 -4
- package/build/modern/environmentManager.d.cts.map +1 -1
- package/build/modern/environmentManager.d.ts +3 -4
- package/build/modern/environmentManager.d.ts.map +1 -1
- package/build/modern/focusManager.d.cts +2 -3
- package/build/modern/focusManager.d.cts.map +1 -1
- package/build/modern/focusManager.d.ts +2 -3
- package/build/modern/focusManager.d.ts.map +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +3 -4
- package/build/modern/infiniteQueryBehavior.d.cts.map +1 -1
- package/build/modern/infiniteQueryBehavior.d.ts +3 -4
- package/build/modern/infiniteQueryBehavior.d.ts.map +1 -1
- package/build/modern/infiniteQueryObserver.d.cts +1 -2
- package/build/modern/infiniteQueryObserver.d.cts.map +1 -1
- package/build/modern/infiniteQueryObserver.d.ts +1 -2
- package/build/modern/infiniteQueryObserver.d.ts.map +1 -1
- package/build/modern/notifyManager.d.cts +3 -4
- package/build/modern/notifyManager.d.cts.map +1 -1
- package/build/modern/notifyManager.d.ts +3 -4
- package/build/modern/notifyManager.d.ts.map +1 -1
- package/build/modern/onlineManager.d.cts +2 -3
- package/build/modern/onlineManager.d.cts.map +1 -1
- package/build/modern/onlineManager.d.ts +2 -3
- package/build/modern/onlineManager.d.ts.map +1 -1
- package/build/modern/queriesObserver.d.cts +2 -3
- package/build/modern/queriesObserver.d.cts.map +1 -1
- package/build/modern/queriesObserver.d.ts +2 -3
- package/build/modern/queriesObserver.d.ts.map +1 -1
- package/build/modern/streamedQuery.cjs.map +1 -1
- package/build/modern/streamedQuery.d.cts +1 -2
- package/build/modern/streamedQuery.d.cts.map +1 -1
- package/build/modern/streamedQuery.d.ts +1 -2
- package/build/modern/streamedQuery.d.ts.map +1 -1
- package/build/modern/streamedQuery.js.map +1 -1
- package/build/modern/timeoutManager.d.cts +7 -8
- package/build/modern/timeoutManager.d.cts.map +1 -1
- package/build/modern/timeoutManager.d.ts +7 -8
- package/build/modern/timeoutManager.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/streamedQuery.ts +1 -0
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
* If we don't accept a single void argument, then
|
|
8
8
|
* `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.
|
|
9
9
|
*/
|
|
10
|
-
type TimeoutCallback = (_: void) => void;
|
|
10
|
+
export type TimeoutCallback = (_: void) => void;
|
|
11
11
|
/**
|
|
12
12
|
* Wrapping `setTimeout` is awkward from a typing perspective because platform
|
|
13
13
|
* typings may extend the return type of `setTimeout`. For example, NodeJS
|
|
14
14
|
* typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be
|
|
15
15
|
* able to return such a type.
|
|
16
16
|
*/
|
|
17
|
-
type ManagedTimerId = number | {
|
|
17
|
+
export type ManagedTimerId = number | {
|
|
18
18
|
[Symbol.toPrimitive]: () => number;
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
@@ -26,13 +26,13 @@ type ManagedTimerId = number | {
|
|
|
26
26
|
* `setTimeout`/`setInterval`) does not do. A custom provider can implement coalescing, and can
|
|
27
27
|
* also support delays longer than the ~24-day maximum of the global `setTimeout`.
|
|
28
28
|
*/
|
|
29
|
-
type TimeoutProvider<TTimerId extends ManagedTimerId = ManagedTimerId> = {
|
|
29
|
+
export type TimeoutProvider<TTimerId extends ManagedTimerId = ManagedTimerId> = {
|
|
30
30
|
readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId;
|
|
31
31
|
readonly clearTimeout: (timeoutId: TTimerId | undefined) => void;
|
|
32
32
|
readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId;
|
|
33
33
|
readonly clearInterval: (intervalId: TTimerId | undefined) => void;
|
|
34
34
|
};
|
|
35
|
-
declare const defaultTimeoutProvider: TimeoutProvider;
|
|
35
|
+
export declare const defaultTimeoutProvider: TimeoutProvider;
|
|
36
36
|
/**
|
|
37
37
|
* Allows customization of how timeouts are created.
|
|
38
38
|
*
|
|
@@ -44,7 +44,7 @@ declare const defaultTimeoutProvider: TimeoutProvider;
|
|
|
44
44
|
* If you hit this limitation, consider providing a custom TimeoutProvider that
|
|
45
45
|
* coalesces timeouts.
|
|
46
46
|
*/
|
|
47
|
-
declare class TimeoutManager implements Omit<TimeoutProvider, 'name'> {
|
|
47
|
+
export declare class TimeoutManager implements Omit<TimeoutProvider, 'name'> {
|
|
48
48
|
#private;
|
|
49
49
|
/**
|
|
50
50
|
* `setTimeoutProvider` can be used to set a custom implementation of the
|
|
@@ -151,7 +151,7 @@ declare class TimeoutManager implements Omit<TimeoutProvider, 'name'> {
|
|
|
151
151
|
/**
|
|
152
152
|
* Singleton instance of {@link TimeoutManager}, used throughout TanStack Query to schedule and cancel timers.
|
|
153
153
|
*/
|
|
154
|
-
declare const timeoutManager: TimeoutManager;
|
|
154
|
+
export declare const timeoutManager: TimeoutManager;
|
|
155
155
|
/**
|
|
156
156
|
* In many cases code wants to delay to the next event loop tick; this is not
|
|
157
157
|
* mediated by {@link timeoutManager}.
|
|
@@ -159,7 +159,6 @@ declare const timeoutManager: TimeoutManager;
|
|
|
159
159
|
* This function is provided to make auditing the `tanstack/query-core` for
|
|
160
160
|
* incorrect use of system `setTimeout` easier.
|
|
161
161
|
*/
|
|
162
|
-
declare function systemSetTimeoutZero(callback: TimeoutCallback): void;
|
|
162
|
+
export declare function systemSetTimeoutZero(callback: TimeoutCallback): void;
|
|
163
163
|
//#endregion
|
|
164
|
-
export { ManagedTimerId, TimeoutCallback, TimeoutManager, TimeoutProvider, defaultTimeoutProvider, systemSetTimeoutZero, timeoutManager };
|
|
165
164
|
//# sourceMappingURL=timeoutManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeoutManager.d.ts","names":[],"sources":["../../src/timeoutManager.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"timeoutManager.d.ts","names":[],"sources":["../../src/timeoutManager.ts"],"mappings":";;;;;;;;;YAQY,mBAAmB;;;;;;;YAQnB;GAA6B,OAAO;;;;;;;;;;;YAWpC,gBAAgB,iBAAiB,iBAAiB;WAEjD,aAAa,UAAU,iBAAiB,kBAAkB;WAC1D,eAAe,WAAW;WAE1B,cAAc,UAAU,iBAAiB,kBAAkB;WAC3D,gBAAgB,YAAY;;qBAK5B,wBAAwB;;;;;;;;;;;;qBA+BxB,0BAA0B,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoC1C,mBAAmB,iBAAiB,gBAClC,UAAU,gBAAgB;;;;;;;;;;;;;;;;;;;;;EAgD5B,WAAW,UAAU,iBAAiB,gBAAgB;;;;;;;;;;;;;;;;;;EAwBtD,aAAa,WAAW;;;;;;;;;;;;;;;;;;EAqBxB,YAAY,UAAU,iBAAiB,gBAAgB;;;;;;;;;;;;;;;;;;EAwBvD,cAAc,YAAY;;;;;qBAQf,gBAAc;;;;;;;;wBASX,qBAAqB,UAAU"}
|
package/package.json
CHANGED
package/src/streamedQuery.ts
CHANGED
|
@@ -93,6 +93,7 @@ export function streamedQuery<
|
|
|
93
93
|
|
|
94
94
|
let result = initialValue
|
|
95
95
|
|
|
96
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
96
97
|
let cancelled: boolean = false as boolean
|
|
97
98
|
const streamFnContext = addConsumeAwareSignal<
|
|
98
99
|
OmitKeyof<typeof context, 'signal'>
|