@tanstack/angular-pacer 0.23.1 → 0.25.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/README.md +21 -6
- package/dist/async-batcher/injectAsyncBatchedCallback.d.ts +2 -5
- package/dist/async-batcher/injectAsyncBatchedCallback.js +1 -2
- package/dist/async-batcher/injectAsyncBatcher.d.ts +4 -7
- package/dist/async-batcher/injectAsyncBatcher.js +1 -2
- package/dist/async-debouncer/injectAsyncDebouncedCallback.d.ts +2 -5
- package/dist/async-debouncer/injectAsyncDebouncedCallback.js +1 -2
- package/dist/async-debouncer/injectAsyncDebouncer.d.ts +4 -7
- package/dist/async-debouncer/injectAsyncDebouncer.js +1 -2
- package/dist/async-queuer/injectAsyncQueuedSignal.d.ts +3 -6
- package/dist/async-queuer/injectAsyncQueuedSignal.js +1 -2
- package/dist/async-queuer/injectAsyncQueuer.d.ts +4 -7
- package/dist/async-queuer/injectAsyncQueuer.js +1 -2
- package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.d.ts +2 -5
- package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.js +1 -2
- package/dist/async-rate-limiter/injectAsyncRateLimiter.d.ts +4 -7
- package/dist/async-rate-limiter/injectAsyncRateLimiter.js +1 -2
- package/dist/async-throttler/injectAsyncThrottledCallback.d.ts +2 -5
- package/dist/async-throttler/injectAsyncThrottledCallback.js +1 -2
- package/dist/async-throttler/injectAsyncThrottler.d.ts +4 -7
- package/dist/async-throttler/injectAsyncThrottler.js +1 -2
- package/dist/batcher/injectBatchedCallback.d.ts +2 -5
- package/dist/batcher/injectBatchedCallback.js +1 -2
- package/dist/batcher/injectBatcher.d.ts +4 -7
- package/dist/batcher/injectBatcher.js +1 -2
- package/dist/debouncer/injectDebouncedCallback.d.ts +2 -5
- package/dist/debouncer/injectDebouncedCallback.js +1 -2
- package/dist/debouncer/injectDebouncedSignal.d.ts +3 -6
- package/dist/debouncer/injectDebouncedSignal.js +1 -2
- package/dist/debouncer/injectDebouncedValue.d.ts +3 -6
- package/dist/debouncer/injectDebouncedValue.js +1 -2
- package/dist/debouncer/injectDebouncer.d.ts +4 -7
- package/dist/debouncer/injectDebouncer.js +1 -2
- package/dist/provider/pacer-context.d.ts +4 -7
- package/dist/provider/pacer-context.js +1 -2
- package/dist/provider/pacer-provider.d.ts +2 -5
- package/dist/provider/pacer-provider.js +1 -2
- package/dist/queuer/injectQueuedSignal.d.ts +3 -6
- package/dist/queuer/injectQueuedSignal.js +1 -2
- package/dist/queuer/injectQueuedValue.d.ts +3 -6
- package/dist/queuer/injectQueuedValue.js +1 -2
- package/dist/queuer/injectQueuer.d.ts +4 -7
- package/dist/queuer/injectQueuer.js +1 -2
- package/dist/rate-limiter/injectRateLimitedCallback.d.ts +2 -5
- package/dist/rate-limiter/injectRateLimitedCallback.js +1 -2
- package/dist/rate-limiter/injectRateLimitedSignal.d.ts +3 -6
- package/dist/rate-limiter/injectRateLimitedSignal.js +1 -2
- package/dist/rate-limiter/injectRateLimitedValue.d.ts +3 -6
- package/dist/rate-limiter/injectRateLimitedValue.js +1 -2
- package/dist/rate-limiter/injectRateLimiter.d.ts +4 -7
- package/dist/rate-limiter/injectRateLimiter.js +1 -2
- package/dist/throttler/injectThrottledCallback.d.ts +2 -5
- package/dist/throttler/injectThrottledCallback.js +1 -2
- package/dist/throttler/injectThrottledSignal.d.ts +3 -8
- package/dist/throttler/injectThrottledSignal.js +1 -4
- package/dist/throttler/injectThrottledValue.d.ts +3 -8
- package/dist/throttler/injectThrottledValue.js +1 -2
- package/dist/throttler/injectThrottler.d.ts +4 -9
- package/dist/throttler/injectThrottler.js +1 -4
- package/package.json +25 -72
- package/dist/async-batcher/index.cjs +0 -13
- package/dist/async-batcher/index.d.cts +0 -4
- package/dist/async-batcher/injectAsyncBatchedCallback.cjs +0 -49
- package/dist/async-batcher/injectAsyncBatchedCallback.cjs.map +0 -1
- package/dist/async-batcher/injectAsyncBatchedCallback.d.cts +0 -45
- package/dist/async-batcher/injectAsyncBatchedCallback.js.map +0 -1
- package/dist/async-batcher/injectAsyncBatcher.cjs +0 -85
- package/dist/async-batcher/injectAsyncBatcher.cjs.map +0 -1
- package/dist/async-batcher/injectAsyncBatcher.d.cts +0 -85
- package/dist/async-batcher/injectAsyncBatcher.js.map +0 -1
- package/dist/async-debouncer/index.cjs +0 -13
- package/dist/async-debouncer/index.d.cts +0 -4
- package/dist/async-debouncer/injectAsyncDebouncedCallback.cjs +0 -49
- package/dist/async-debouncer/injectAsyncDebouncedCallback.cjs.map +0 -1
- package/dist/async-debouncer/injectAsyncDebouncedCallback.d.cts +0 -43
- package/dist/async-debouncer/injectAsyncDebouncedCallback.js.map +0 -1
- package/dist/async-debouncer/injectAsyncDebouncer.cjs +0 -107
- package/dist/async-debouncer/injectAsyncDebouncer.cjs.map +0 -1
- package/dist/async-debouncer/injectAsyncDebouncer.d.cts +0 -108
- package/dist/async-debouncer/injectAsyncDebouncer.js.map +0 -1
- package/dist/async-queuer/index.cjs +0 -13
- package/dist/async-queuer/index.d.cts +0 -4
- package/dist/async-queuer/injectAsyncQueuedSignal.cjs +0 -53
- package/dist/async-queuer/injectAsyncQueuedSignal.cjs.map +0 -1
- package/dist/async-queuer/injectAsyncQueuedSignal.d.cts +0 -50
- package/dist/async-queuer/injectAsyncQueuedSignal.js.map +0 -1
- package/dist/async-queuer/injectAsyncQueuer.cjs +0 -85
- package/dist/async-queuer/injectAsyncQueuer.cjs.map +0 -1
- package/dist/async-queuer/injectAsyncQueuer.d.cts +0 -85
- package/dist/async-queuer/injectAsyncQueuer.js.map +0 -1
- package/dist/async-rate-limiter/index.cjs +0 -13
- package/dist/async-rate-limiter/index.d.cts +0 -4
- package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.cjs +0 -52
- package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.cjs.map +0 -1
- package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.d.cts +0 -46
- package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.js.map +0 -1
- package/dist/async-rate-limiter/injectAsyncRateLimiter.cjs +0 -69
- package/dist/async-rate-limiter/injectAsyncRateLimiter.cjs.map +0 -1
- package/dist/async-rate-limiter/injectAsyncRateLimiter.d.cts +0 -72
- package/dist/async-rate-limiter/injectAsyncRateLimiter.js.map +0 -1
- package/dist/async-retryer/index.cjs +0 -9
- package/dist/async-retryer/index.d.cts +0 -1
- package/dist/async-throttler/index.cjs +0 -13
- package/dist/async-throttler/index.d.cts +0 -4
- package/dist/async-throttler/injectAsyncThrottledCallback.cjs +0 -50
- package/dist/async-throttler/injectAsyncThrottledCallback.cjs.map +0 -1
- package/dist/async-throttler/injectAsyncThrottledCallback.d.cts +0 -44
- package/dist/async-throttler/injectAsyncThrottledCallback.js.map +0 -1
- package/dist/async-throttler/injectAsyncThrottler.cjs +0 -86
- package/dist/async-throttler/injectAsyncThrottler.cjs.map +0 -1
- package/dist/async-throttler/injectAsyncThrottler.d.cts +0 -87
- package/dist/async-throttler/injectAsyncThrottler.js.map +0 -1
- package/dist/batcher/index.cjs +0 -13
- package/dist/batcher/index.d.cts +0 -4
- package/dist/batcher/injectBatchedCallback.cjs +0 -47
- package/dist/batcher/injectBatchedCallback.cjs.map +0 -1
- package/dist/batcher/injectBatchedCallback.d.cts +0 -43
- package/dist/batcher/injectBatchedCallback.js.map +0 -1
- package/dist/batcher/injectBatcher.cjs +0 -75
- package/dist/batcher/injectBatcher.cjs.map +0 -1
- package/dist/batcher/injectBatcher.d.cts +0 -77
- package/dist/batcher/injectBatcher.js.map +0 -1
- package/dist/debouncer/index.cjs +0 -17
- package/dist/debouncer/index.d.cts +0 -6
- package/dist/debouncer/injectDebouncedCallback.cjs +0 -46
- package/dist/debouncer/injectDebouncedCallback.cjs.map +0 -1
- package/dist/debouncer/injectDebouncedCallback.d.cts +0 -43
- package/dist/debouncer/injectDebouncedCallback.js.map +0 -1
- package/dist/debouncer/injectDebouncedSignal.cjs +0 -68
- package/dist/debouncer/injectDebouncedSignal.cjs.map +0 -1
- package/dist/debouncer/injectDebouncedSignal.d.cts +0 -60
- package/dist/debouncer/injectDebouncedSignal.js.map +0 -1
- package/dist/debouncer/injectDebouncedValue.cjs +0 -17
- package/dist/debouncer/injectDebouncedValue.cjs.map +0 -1
- package/dist/debouncer/injectDebouncedValue.d.cts +0 -76
- package/dist/debouncer/injectDebouncedValue.js.map +0 -1
- package/dist/debouncer/injectDebouncer.cjs +0 -95
- package/dist/debouncer/injectDebouncer.cjs.map +0 -1
- package/dist/debouncer/injectDebouncer.d.cts +0 -98
- package/dist/debouncer/injectDebouncer.js.map +0 -1
- package/dist/index.cjs +0 -65
- package/dist/index.d.cts +0 -30
- package/dist/provider/index.cjs +0 -7
- package/dist/provider/index.d.cts +0 -3
- package/dist/provider/pacer-context.cjs +0 -20
- package/dist/provider/pacer-context.cjs.map +0 -1
- package/dist/provider/pacer-context.d.cts +0 -21
- package/dist/provider/pacer-context.js.map +0 -1
- package/dist/provider/pacer-provider.cjs +0 -41
- package/dist/provider/pacer-provider.cjs.map +0 -1
- package/dist/provider/pacer-provider.d.cts +0 -36
- package/dist/provider/pacer-provider.js.map +0 -1
- package/dist/queuer/index.cjs +0 -15
- package/dist/queuer/index.d.cts +0 -5
- package/dist/queuer/injectQueuedSignal.cjs +0 -47
- package/dist/queuer/injectQueuedSignal.cjs.map +0 -1
- package/dist/queuer/injectQueuedSignal.d.cts +0 -44
- package/dist/queuer/injectQueuedSignal.js.map +0 -1
- package/dist/queuer/injectQueuedValue.cjs +0 -23
- package/dist/queuer/injectQueuedValue.cjs.map +0 -1
- package/dist/queuer/injectQueuedValue.d.cts +0 -34
- package/dist/queuer/injectQueuedValue.js.map +0 -1
- package/dist/queuer/injectQueuer.cjs +0 -80
- package/dist/queuer/injectQueuer.cjs.map +0 -1
- package/dist/queuer/injectQueuer.d.cts +0 -82
- package/dist/queuer/injectQueuer.js.map +0 -1
- package/dist/rate-limiter/index.cjs +0 -17
- package/dist/rate-limiter/index.d.cts +0 -6
- package/dist/rate-limiter/injectRateLimitedCallback.cjs +0 -45
- package/dist/rate-limiter/injectRateLimitedCallback.cjs.map +0 -1
- package/dist/rate-limiter/injectRateLimitedCallback.d.cts +0 -42
- package/dist/rate-limiter/injectRateLimitedCallback.js.map +0 -1
- package/dist/rate-limiter/injectRateLimitedSignal.cjs +0 -62
- package/dist/rate-limiter/injectRateLimitedSignal.cjs.map +0 -1
- package/dist/rate-limiter/injectRateLimitedSignal.d.cts +0 -54
- package/dist/rate-limiter/injectRateLimitedSignal.js.map +0 -1
- package/dist/rate-limiter/injectRateLimitedValue.cjs +0 -17
- package/dist/rate-limiter/injectRateLimitedValue.cjs.map +0 -1
- package/dist/rate-limiter/injectRateLimitedValue.d.cts +0 -49
- package/dist/rate-limiter/injectRateLimitedValue.js.map +0 -1
- package/dist/rate-limiter/injectRateLimiter.cjs +0 -100
- package/dist/rate-limiter/injectRateLimiter.cjs.map +0 -1
- package/dist/rate-limiter/injectRateLimiter.d.cts +0 -103
- package/dist/rate-limiter/injectRateLimiter.js.map +0 -1
- package/dist/throttler/index.cjs +0 -17
- package/dist/throttler/index.d.cts +0 -6
- package/dist/throttler/injectThrottledCallback.cjs +0 -45
- package/dist/throttler/injectThrottledCallback.cjs.map +0 -1
- package/dist/throttler/injectThrottledCallback.d.cts +0 -42
- package/dist/throttler/injectThrottledCallback.js.map +0 -1
- package/dist/throttler/injectThrottledSignal.cjs +0 -69
- package/dist/throttler/injectThrottledSignal.cjs.map +0 -1
- package/dist/throttler/injectThrottledSignal.d.cts +0 -61
- package/dist/throttler/injectThrottledSignal.js.map +0 -1
- package/dist/throttler/injectThrottledValue.cjs +0 -17
- package/dist/throttler/injectThrottledValue.cjs.map +0 -1
- package/dist/throttler/injectThrottledValue.d.cts +0 -74
- package/dist/throttler/injectThrottledValue.js.map +0 -1
- package/dist/throttler/injectThrottler.cjs +0 -95
- package/dist/throttler/injectThrottler.cjs.map +0 -1
- package/dist/throttler/injectThrottler.d.cts +0 -98
- package/dist/throttler/injectThrottler.js.map +0 -1
- package/dist/types/index.cjs +0 -9
- package/dist/types/index.d.cts +0 -1
- package/dist/utils/index.cjs +0 -9
- package/dist/utils/index.d.cts +0 -1
- package/src/async-batcher/index.ts +0 -4
- package/src/async-batcher/injectAsyncBatchedCallback.ts +0 -48
- package/src/async-batcher/injectAsyncBatcher.ts +0 -126
- package/src/async-debouncer/index.ts +0 -4
- package/src/async-debouncer/injectAsyncDebouncedCallback.ts +0 -50
- package/src/async-debouncer/injectAsyncDebouncer.ts +0 -152
- package/src/async-queuer/index.ts +0 -4
- package/src/async-queuer/injectAsyncQueuedSignal.ts +0 -74
- package/src/async-queuer/injectAsyncQueuer.ts +0 -126
- package/src/async-rate-limiter/index.ts +0 -4
- package/src/async-rate-limiter/injectAsyncRateLimitedCallback.ts +0 -52
- package/src/async-rate-limiter/injectAsyncRateLimiter.ts +0 -115
- package/src/async-retryer/index.ts +0 -1
- package/src/async-throttler/index.ts +0 -4
- package/src/async-throttler/injectAsyncThrottledCallback.ts +0 -50
- package/src/async-throttler/injectAsyncThrottler.ts +0 -131
- package/src/batcher/index.ts +0 -4
- package/src/batcher/injectBatchedCallback.ts +0 -46
- package/src/batcher/injectBatcher.ts +0 -114
- package/src/debouncer/index.ts +0 -6
- package/src/debouncer/injectDebouncedCallback.ts +0 -46
- package/src/debouncer/injectDebouncedSignal.ts +0 -94
- package/src/debouncer/injectDebouncedValue.ts +0 -126
- package/src/debouncer/injectDebouncer.ts +0 -137
- package/src/index.ts +0 -40
- package/src/provider/index.ts +0 -2
- package/src/provider/pacer-context.ts +0 -46
- package/src/provider/pacer-provider.ts +0 -38
- package/src/queuer/index.ts +0 -5
- package/src/queuer/injectQueuedSignal.ts +0 -65
- package/src/queuer/injectQueuedValue.ts +0 -101
- package/src/queuer/injectQueuer.ts +0 -118
- package/src/rate-limiter/index.ts +0 -6
- package/src/rate-limiter/injectRateLimitedCallback.ts +0 -45
- package/src/rate-limiter/injectRateLimitedSignal.ts +0 -88
- package/src/rate-limiter/injectRateLimitedValue.ts +0 -99
- package/src/rate-limiter/injectRateLimiter.ts +0 -140
- package/src/throttler/index.ts +0 -6
- package/src/throttler/injectThrottledCallback.ts +0 -45
- package/src/throttler/injectThrottledSignal.ts +0 -95
- package/src/throttler/injectThrottledValue.ts +0 -124
- package/src/throttler/injectThrottler.ts +0 -137
- package/src/types/index.ts +0 -1
- package/src/utils/index.ts +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<
|
|
2
|
+
<picture>
|
|
3
|
+
<source
|
|
4
|
+
media="(prefers-color-scheme: dark)"
|
|
5
|
+
srcset="https://tanstack.com/api/readme/pacer.png?theme=dark"
|
|
6
|
+
/>
|
|
7
|
+
<source
|
|
8
|
+
media="(prefers-color-scheme: light)"
|
|
9
|
+
srcset="https://tanstack.com/api/readme/pacer.png"
|
|
10
|
+
/>
|
|
11
|
+
<img
|
|
12
|
+
src="https://tanstack.com/api/readme/pacer.png"
|
|
13
|
+
alt="TanStack Pacer"
|
|
14
|
+
width="900"
|
|
15
|
+
/>
|
|
16
|
+
</picture>
|
|
3
17
|
</div>
|
|
4
18
|
|
|
5
19
|
<br />
|
|
@@ -29,8 +43,9 @@
|
|
|
29
43
|
</div>
|
|
30
44
|
|
|
31
45
|
<div align="center">
|
|
32
|
-
|
|
46
|
+
|
|
33
47
|
### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
|
|
48
|
+
|
|
34
49
|
</div>
|
|
35
50
|
|
|
36
51
|
# TanStack Pacer
|
|
@@ -88,10 +103,10 @@ A lightweight timing and scheduling library for debouncing, throttling, rate lim
|
|
|
88
103
|
> [!NOTE]
|
|
89
104
|
> You may know **TanStack Pacer** by our adapter names, too!
|
|
90
105
|
>
|
|
91
|
-
> - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react
|
|
92
|
-
> - [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact
|
|
93
|
-
> - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid
|
|
94
|
-
> - [**Angular Pacer**](https://tanstack.com/pacer/latest/docs/framework/angular
|
|
106
|
+
> - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react)
|
|
107
|
+
> - [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact)
|
|
108
|
+
> - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid)
|
|
109
|
+
> - [**Angular Pacer**](https://tanstack.com/pacer/latest/docs/framework/angular)
|
|
95
110
|
> - Svelte Pacer - needs a contributor!
|
|
96
111
|
> - Vue Pacer - needs a contributor!
|
|
97
112
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AsyncBatcherOptions } from "@tanstack/pacer/async-batcher";
|
|
2
|
-
|
|
3
2
|
//#region src/async-batcher/injectAsyncBatchedCallback.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* An Angular function that creates an async batched version of a callback function.
|
|
@@ -39,7 +38,5 @@ import { AsyncBatcherOptions } from "@tanstack/pacer/async-batcher";
|
|
|
39
38
|
* await batchApiCall(data2);
|
|
40
39
|
* ```
|
|
41
40
|
*/
|
|
42
|
-
declare function injectAsyncBatchedCallback<TValue>(fn: (items: Array<TValue>) => Promise<any>, options: AsyncBatcherOptions<TValue>): (item: TValue) => Promise<void>;
|
|
43
|
-
//#endregion
|
|
44
|
-
export { injectAsyncBatchedCallback };
|
|
45
|
-
//# sourceMappingURL=injectAsyncBatchedCallback.d.ts.map
|
|
41
|
+
export declare function injectAsyncBatchedCallback<TValue>(fn: (items: Array<TValue>) => Promise<any>, options: AsyncBatcherOptions<TValue>): (item: TValue) => Promise<void>;
|
|
42
|
+
//#endregion
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Signal } from "@angular/core";
|
|
2
2
|
import { Store } from "@tanstack/angular-store";
|
|
3
3
|
import { AsyncBatcher, AsyncBatcherOptions, AsyncBatcherState } from "@tanstack/pacer/async-batcher";
|
|
4
|
-
|
|
5
4
|
//#region src/async-batcher/injectAsyncBatcher.d.ts
|
|
6
|
-
interface AngularAsyncBatcherOptions<TValue, TSelected = {}> extends AsyncBatcherOptions<TValue> {
|
|
5
|
+
export interface AngularAsyncBatcherOptions<TValue, TSelected = {}> extends AsyncBatcherOptions<TValue> {
|
|
7
6
|
/**
|
|
8
7
|
* Optional callback invoked when the component is destroyed. Receives the batcher instance.
|
|
9
8
|
* When provided, replaces the default cleanup (cancel + abort); use it to call flush(), cancel(), add logging, etc.
|
|
@@ -11,7 +10,7 @@ interface AngularAsyncBatcherOptions<TValue, TSelected = {}> extends AsyncBatche
|
|
|
11
10
|
*/
|
|
12
11
|
onUnmount?: (batcher: AngularAsyncBatcher<TValue, TSelected>) => void;
|
|
13
12
|
}
|
|
14
|
-
interface AngularAsyncBatcher<TValue, TSelected = {}> extends Omit<AsyncBatcher<TValue>, 'store'> {
|
|
13
|
+
export interface AngularAsyncBatcher<TValue, TSelected = {}> extends Omit<AsyncBatcher<TValue>, 'store'> {
|
|
15
14
|
/**
|
|
16
15
|
* Reactive state signal that will be updated when the async batcher state changes
|
|
17
16
|
*
|
|
@@ -79,7 +78,5 @@ interface AngularAsyncBatcher<TValue, TSelected = {}> extends Omit<AsyncBatcher<
|
|
|
79
78
|
* const { items, isExecuting } = batcher.state();
|
|
80
79
|
* ```
|
|
81
80
|
*/
|
|
82
|
-
declare function injectAsyncBatcher<TValue, TSelected = {}>(fn: (items: Array<TValue>) => Promise<any>, options?: AngularAsyncBatcherOptions<TValue, TSelected>, selector?: (state: AsyncBatcherState<TValue>) => TSelected): AngularAsyncBatcher<TValue, TSelected>;
|
|
83
|
-
//#endregion
|
|
84
|
-
export { AngularAsyncBatcher, AngularAsyncBatcherOptions, injectAsyncBatcher };
|
|
85
|
-
//# sourceMappingURL=injectAsyncBatcher.d.ts.map
|
|
81
|
+
export declare function injectAsyncBatcher<TValue, TSelected = {}>(fn: (items: Array<TValue>) => Promise<any>, options?: AngularAsyncBatcherOptions<TValue, TSelected>, selector?: (state: AsyncBatcherState<TValue>) => TSelected): AngularAsyncBatcher<TValue, TSelected>;
|
|
82
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AsyncDebouncerOptions } from "@tanstack/pacer/async-debouncer";
|
|
2
2
|
import { AnyAsyncFunction } from "@tanstack/pacer/types";
|
|
3
|
-
|
|
4
3
|
//#region src/async-debouncer/injectAsyncDebouncedCallback.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* An Angular function that creates an async debounced version of a callback function.
|
|
@@ -37,7 +36,5 @@ import { AnyAsyncFunction } from "@tanstack/pacer/types";
|
|
|
37
36
|
* const results = await handleSearch(searchQuery);
|
|
38
37
|
* ```
|
|
39
38
|
*/
|
|
40
|
-
declare function injectAsyncDebouncedCallback<TFn extends AnyAsyncFunction>(fn: TFn, options: AsyncDebouncerOptions<TFn>): (...args: Parameters<TFn>) => Promise<Awaited<ReturnType<TFn>> | undefined>;
|
|
41
|
-
//#endregion
|
|
42
|
-
export { injectAsyncDebouncedCallback };
|
|
43
|
-
//# sourceMappingURL=injectAsyncDebouncedCallback.d.ts.map
|
|
39
|
+
export declare function injectAsyncDebouncedCallback<TFn extends AnyAsyncFunction>(fn: TFn, options: AsyncDebouncerOptions<TFn>): (...args: Parameters<TFn>) => Promise<Awaited<ReturnType<TFn>> | undefined>;
|
|
40
|
+
//#endregion
|
|
@@ -2,9 +2,8 @@ import { Signal } from "@angular/core";
|
|
|
2
2
|
import { Store } from "@tanstack/angular-store";
|
|
3
3
|
import { AsyncDebouncer, AsyncDebouncerOptions, AsyncDebouncerState } from "@tanstack/pacer/async-debouncer";
|
|
4
4
|
import { AnyAsyncFunction } from "@tanstack/pacer/types";
|
|
5
|
-
|
|
6
5
|
//#region src/async-debouncer/injectAsyncDebouncer.d.ts
|
|
7
|
-
interface AngularAsyncDebouncerOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncDebouncerOptions<TFn> {
|
|
6
|
+
export interface AngularAsyncDebouncerOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncDebouncerOptions<TFn> {
|
|
8
7
|
/**
|
|
9
8
|
* Optional callback invoked when the component is destroyed. Receives the debouncer instance.
|
|
10
9
|
* When provided, replaces the default cleanup (cancel + abort); use it to call flush(), cancel(), add logging, etc.
|
|
@@ -12,7 +11,7 @@ interface AngularAsyncDebouncerOptions<TFn extends AnyAsyncFunction, TSelected =
|
|
|
12
11
|
*/
|
|
13
12
|
onUnmount?: (debouncer: AngularAsyncDebouncer<TFn, TSelected>) => void;
|
|
14
13
|
}
|
|
15
|
-
interface AngularAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncDebouncer<TFn>, 'store'> {
|
|
14
|
+
export interface AngularAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncDebouncer<TFn>, 'store'> {
|
|
16
15
|
/**
|
|
17
16
|
* Reactive state signal that will be updated when the async debouncer state changes
|
|
18
17
|
*
|
|
@@ -102,7 +101,5 @@ interface AngularAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}> ex
|
|
|
102
101
|
* const { isExecuting, errorCount } = debouncer.state();
|
|
103
102
|
* ```
|
|
104
103
|
*/
|
|
105
|
-
declare function injectAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: AngularAsyncDebouncerOptions<TFn, TSelected>, selector?: (state: AsyncDebouncerState<TFn>) => TSelected): AngularAsyncDebouncer<TFn, TSelected>;
|
|
106
|
-
//#endregion
|
|
107
|
-
export { AngularAsyncDebouncer, AngularAsyncDebouncerOptions, injectAsyncDebouncer };
|
|
108
|
-
//# sourceMappingURL=injectAsyncDebouncer.d.ts.map
|
|
104
|
+
export declare function injectAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: AngularAsyncDebouncerOptions<TFn, TSelected>, selector?: (state: AsyncDebouncerState<TFn>) => TSelected): AngularAsyncDebouncer<TFn, TSelected>;
|
|
105
|
+
//#endregion
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { AngularAsyncQueuer } from "./injectAsyncQueuer.js";
|
|
2
2
|
import { AsyncQueuerOptions, AsyncQueuerState } from "@tanstack/pacer/async-queuer";
|
|
3
|
-
|
|
4
3
|
//#region src/async-queuer/injectAsyncQueuedSignal.d.ts
|
|
5
|
-
interface AsyncQueuedSignal<TValue, TSelected = {}> {
|
|
4
|
+
export interface AsyncQueuedSignal<TValue, TSelected = {}> {
|
|
6
5
|
(): Array<TValue>;
|
|
7
6
|
addItem: AngularAsyncQueuer<TValue, TSelected>['addItem'];
|
|
8
7
|
queuer: AngularAsyncQueuer<TValue, TSelected>;
|
|
@@ -44,7 +43,5 @@ interface AsyncQueuedSignal<TValue, TSelected = {}> {
|
|
|
44
43
|
* queued.queuer.stop();
|
|
45
44
|
* ```
|
|
46
45
|
*/
|
|
47
|
-
declare function injectAsyncQueuedSignal<TValue, TSelected extends Pick<AsyncQueuerState<TValue>, 'items'> = Pick<AsyncQueuerState<TValue>, 'items'>>(fn: (value: TValue) => Promise<any>, options?: AsyncQueuerOptions<TValue>, selector?: (state: AsyncQueuerState<TValue>) => TSelected): AsyncQueuedSignal<TValue, TSelected>;
|
|
48
|
-
//#endregion
|
|
49
|
-
export { AsyncQueuedSignal, injectAsyncQueuedSignal };
|
|
50
|
-
//# sourceMappingURL=injectAsyncQueuedSignal.d.ts.map
|
|
46
|
+
export declare function injectAsyncQueuedSignal<TValue, TSelected extends Pick<AsyncQueuerState<TValue>, 'items'> = Pick<AsyncQueuerState<TValue>, 'items'>>(fn: (value: TValue) => Promise<any>, options?: AsyncQueuerOptions<TValue>, selector?: (state: AsyncQueuerState<TValue>) => TSelected): AsyncQueuedSignal<TValue, TSelected>;
|
|
47
|
+
//#endregion
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Signal } from "@angular/core";
|
|
2
2
|
import { Store } from "@tanstack/angular-store";
|
|
3
3
|
import { AsyncQueuer, AsyncQueuerOptions, AsyncQueuerState } from "@tanstack/pacer/async-queuer";
|
|
4
|
-
|
|
5
4
|
//#region src/async-queuer/injectAsyncQueuer.d.ts
|
|
6
|
-
interface AngularAsyncQueuerOptions<TValue, TSelected = {}> extends AsyncQueuerOptions<TValue> {
|
|
5
|
+
export interface AngularAsyncQueuerOptions<TValue, TSelected = {}> extends AsyncQueuerOptions<TValue> {
|
|
7
6
|
/**
|
|
8
7
|
* Optional callback invoked when the component is destroyed. Receives the queuer instance.
|
|
9
8
|
* When provided, replaces the default cleanup (stop + abort); use it to call flush(), stop(), add logging, etc.
|
|
@@ -11,7 +10,7 @@ interface AngularAsyncQueuerOptions<TValue, TSelected = {}> extends AsyncQueuerO
|
|
|
11
10
|
*/
|
|
12
11
|
onUnmount?: (queuer: AngularAsyncQueuer<TValue, TSelected>) => void;
|
|
13
12
|
}
|
|
14
|
-
interface AngularAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TValue>, 'store'> {
|
|
13
|
+
export interface AngularAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TValue>, 'store'> {
|
|
15
14
|
/**
|
|
16
15
|
* Reactive state signal that will be updated when the async queuer state changes
|
|
17
16
|
*
|
|
@@ -79,7 +78,5 @@ interface AngularAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TV
|
|
|
79
78
|
* const { items, isExecuting } = queuer.state();
|
|
80
79
|
* ```
|
|
81
80
|
*/
|
|
82
|
-
declare function injectAsyncQueuer<TValue, TSelected = {}>(fn: (value: TValue) => Promise<any>, options?: AngularAsyncQueuerOptions<TValue, TSelected>, selector?: (state: AsyncQueuerState<TValue>) => TSelected): AngularAsyncQueuer<TValue, TSelected>;
|
|
83
|
-
//#endregion
|
|
84
|
-
export { AngularAsyncQueuer, AngularAsyncQueuerOptions, injectAsyncQueuer };
|
|
85
|
-
//# sourceMappingURL=injectAsyncQueuer.d.ts.map
|
|
81
|
+
export declare function injectAsyncQueuer<TValue, TSelected = {}>(fn: (value: TValue) => Promise<any>, options?: AngularAsyncQueuerOptions<TValue, TSelected>, selector?: (state: AsyncQueuerState<TValue>) => TSelected): AngularAsyncQueuer<TValue, TSelected>;
|
|
82
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AsyncRateLimiterOptions } from "@tanstack/pacer/async-rate-limiter";
|
|
2
2
|
import { AnyAsyncFunction } from "@tanstack/pacer/types";
|
|
3
|
-
|
|
4
3
|
//#region src/async-rate-limiter/injectAsyncRateLimitedCallback.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* An Angular function that creates an async rate-limited version of a callback function.
|
|
@@ -40,7 +39,5 @@ import { AnyAsyncFunction } from "@tanstack/pacer/types";
|
|
|
40
39
|
* const result = await makeApiCall(apiData);
|
|
41
40
|
* ```
|
|
42
41
|
*/
|
|
43
|
-
declare function injectAsyncRateLimitedCallback<TFn extends AnyAsyncFunction>(fn: TFn, options: AsyncRateLimiterOptions<TFn>): (...args: Parameters<TFn>) => Promise<Awaited<ReturnType<TFn>> | undefined>;
|
|
44
|
-
//#endregion
|
|
45
|
-
export { injectAsyncRateLimitedCallback };
|
|
46
|
-
//# sourceMappingURL=injectAsyncRateLimitedCallback.d.ts.map
|
|
42
|
+
export declare function injectAsyncRateLimitedCallback<TFn extends AnyAsyncFunction>(fn: TFn, options: AsyncRateLimiterOptions<TFn>): (...args: Parameters<TFn>) => Promise<Awaited<ReturnType<TFn>> | undefined>;
|
|
43
|
+
//#endregion
|
|
@@ -2,16 +2,15 @@ import { Signal } from "@angular/core";
|
|
|
2
2
|
import { Store } from "@tanstack/angular-store";
|
|
3
3
|
import { AsyncRateLimiter, AsyncRateLimiterOptions, AsyncRateLimiterState } from "@tanstack/pacer/async-rate-limiter";
|
|
4
4
|
import { AnyAsyncFunction } from "@tanstack/pacer/types";
|
|
5
|
-
|
|
6
5
|
//#region src/async-rate-limiter/injectAsyncRateLimiter.d.ts
|
|
7
|
-
interface AngularAsyncRateLimiterOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncRateLimiterOptions<TFn> {
|
|
6
|
+
export interface AngularAsyncRateLimiterOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncRateLimiterOptions<TFn> {
|
|
8
7
|
/**
|
|
9
8
|
* Optional callback invoked when the component is destroyed. Receives the rate limiter instance.
|
|
10
9
|
* When provided, replaces the default cleanup (abort).
|
|
11
10
|
*/
|
|
12
11
|
onUnmount?: (rateLimiter: AngularAsyncRateLimiter<TFn, TSelected>) => void;
|
|
13
12
|
}
|
|
14
|
-
interface AngularAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncRateLimiter<TFn>, 'store'> {
|
|
13
|
+
export interface AngularAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncRateLimiter<TFn>, 'store'> {
|
|
15
14
|
/**
|
|
16
15
|
* Reactive state signal that will be updated when the async rate limiter state changes
|
|
17
16
|
*
|
|
@@ -66,7 +65,5 @@ interface AngularAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}>
|
|
|
66
65
|
* };
|
|
67
66
|
* ```
|
|
68
67
|
*/
|
|
69
|
-
declare function injectAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: AngularAsyncRateLimiterOptions<TFn, TSelected>, selector?: (state: AsyncRateLimiterState<TFn>) => TSelected): AngularAsyncRateLimiter<TFn, TSelected>;
|
|
70
|
-
//#endregion
|
|
71
|
-
export { AngularAsyncRateLimiter, AngularAsyncRateLimiterOptions, injectAsyncRateLimiter };
|
|
72
|
-
//# sourceMappingURL=injectAsyncRateLimiter.d.ts.map
|
|
68
|
+
export declare function injectAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: AngularAsyncRateLimiterOptions<TFn, TSelected>, selector?: (state: AsyncRateLimiterState<TFn>) => TSelected): AngularAsyncRateLimiter<TFn, TSelected>;
|
|
69
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AsyncThrottlerOptions } from "@tanstack/pacer/async-throttler";
|
|
2
2
|
import { AnyAsyncFunction } from "@tanstack/pacer/types";
|
|
3
|
-
|
|
4
3
|
//#region src/async-throttler/injectAsyncThrottledCallback.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* An Angular function that creates an async throttled version of a callback function.
|
|
@@ -38,7 +37,5 @@ import { AnyAsyncFunction } from "@tanstack/pacer/types";
|
|
|
38
37
|
* const result = await handleUpdate(updateData);
|
|
39
38
|
* ```
|
|
40
39
|
*/
|
|
41
|
-
declare function injectAsyncThrottledCallback<TFn extends AnyAsyncFunction>(fn: TFn, options: AsyncThrottlerOptions<TFn>): (...args: Parameters<TFn>) => Promise<Awaited<ReturnType<TFn>> | undefined>;
|
|
42
|
-
//#endregion
|
|
43
|
-
export { injectAsyncThrottledCallback };
|
|
44
|
-
//# sourceMappingURL=injectAsyncThrottledCallback.d.ts.map
|
|
40
|
+
export declare function injectAsyncThrottledCallback<TFn extends AnyAsyncFunction>(fn: TFn, options: AsyncThrottlerOptions<TFn>): (...args: Parameters<TFn>) => Promise<Awaited<ReturnType<TFn>> | undefined>;
|
|
41
|
+
//#endregion
|
|
@@ -2,9 +2,8 @@ import { Signal } from "@angular/core";
|
|
|
2
2
|
import { Store } from "@tanstack/angular-store";
|
|
3
3
|
import { AsyncThrottler, AsyncThrottlerOptions, AsyncThrottlerState } from "@tanstack/pacer/async-throttler";
|
|
4
4
|
import { AnyAsyncFunction } from "@tanstack/pacer/types";
|
|
5
|
-
|
|
6
5
|
//#region src/async-throttler/injectAsyncThrottler.d.ts
|
|
7
|
-
interface AngularAsyncThrottlerOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncThrottlerOptions<TFn> {
|
|
6
|
+
export interface AngularAsyncThrottlerOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncThrottlerOptions<TFn> {
|
|
8
7
|
/**
|
|
9
8
|
* Optional callback invoked when the component is destroyed. Receives the throttler instance.
|
|
10
9
|
* When provided, replaces the default cleanup (cancel + abort); use it to call flush(), cancel(), add logging, etc.
|
|
@@ -12,7 +11,7 @@ interface AngularAsyncThrottlerOptions<TFn extends AnyAsyncFunction, TSelected =
|
|
|
12
11
|
*/
|
|
13
12
|
onUnmount?: (throttler: AngularAsyncThrottler<TFn, TSelected>) => void;
|
|
14
13
|
}
|
|
15
|
-
interface AngularAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncThrottler<TFn>, 'store'> {
|
|
14
|
+
export interface AngularAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncThrottler<TFn>, 'store'> {
|
|
16
15
|
/**
|
|
17
16
|
* Reactive state signal that will be updated when the async throttler state changes
|
|
18
17
|
*
|
|
@@ -81,7 +80,5 @@ interface AngularAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}> ex
|
|
|
81
80
|
* };
|
|
82
81
|
* ```
|
|
83
82
|
*/
|
|
84
|
-
declare function injectAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: AngularAsyncThrottlerOptions<TFn, TSelected>, selector?: (state: AsyncThrottlerState<TFn>) => TSelected): AngularAsyncThrottler<TFn, TSelected>;
|
|
85
|
-
//#endregion
|
|
86
|
-
export { AngularAsyncThrottler, AngularAsyncThrottlerOptions, injectAsyncThrottler };
|
|
87
|
-
//# sourceMappingURL=injectAsyncThrottler.d.ts.map
|
|
83
|
+
export declare function injectAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: AngularAsyncThrottlerOptions<TFn, TSelected>, selector?: (state: AsyncThrottlerState<TFn>) => TSelected): AngularAsyncThrottler<TFn, TSelected>;
|
|
84
|
+
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BatcherOptions } from "@tanstack/pacer/batcher";
|
|
2
|
-
|
|
3
2
|
//#region src/batcher/injectBatchedCallback.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* An Angular function that creates a batched version of a callback function.
|
|
@@ -37,7 +36,5 @@ import { BatcherOptions } from "@tanstack/pacer/batcher";
|
|
|
37
36
|
* batchApiCall('item2');
|
|
38
37
|
* ```
|
|
39
38
|
*/
|
|
40
|
-
declare function injectBatchedCallback<TValue>(fn: (items: Array<TValue>) => void, options: BatcherOptions<TValue>): (item: TValue) => void;
|
|
41
|
-
//#endregion
|
|
42
|
-
export { injectBatchedCallback };
|
|
43
|
-
//# sourceMappingURL=injectBatchedCallback.d.ts.map
|
|
39
|
+
export declare function injectBatchedCallback<TValue>(fn: (items: Array<TValue>) => void, options: BatcherOptions<TValue>): (item: TValue) => void;
|
|
40
|
+
//#endregion
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { Signal } from "@angular/core";
|
|
2
2
|
import { Store } from "@tanstack/angular-store";
|
|
3
3
|
import { Batcher, BatcherOptions, BatcherState } from "@tanstack/pacer/batcher";
|
|
4
|
-
|
|
5
4
|
//#region src/batcher/injectBatcher.d.ts
|
|
6
|
-
interface AngularBatcherOptions<TValue, TSelected = {}> extends BatcherOptions<TValue> {
|
|
5
|
+
export interface AngularBatcherOptions<TValue, TSelected = {}> extends BatcherOptions<TValue> {
|
|
7
6
|
/**
|
|
8
7
|
* Optional callback invoked when the component is destroyed. Receives the batcher instance.
|
|
9
8
|
* When provided, replaces the default cleanup (cancel); use it to call flush(), cancel(), add logging, etc.
|
|
10
9
|
*/
|
|
11
10
|
onUnmount?: (batcher: AngularBatcher<TValue, TSelected>) => void;
|
|
12
11
|
}
|
|
13
|
-
interface AngularBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, 'store'> {
|
|
12
|
+
export interface AngularBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, 'store'> {
|
|
14
13
|
/**
|
|
15
14
|
* Reactive state signal that will be updated when the batcher state changes
|
|
16
15
|
*
|
|
@@ -71,7 +70,5 @@ interface AngularBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, '
|
|
|
71
70
|
* const { items, isPending } = batcher.state();
|
|
72
71
|
* ```
|
|
73
72
|
*/
|
|
74
|
-
declare function injectBatcher<TValue, TSelected = {}>(fn: (items: Array<TValue>) => void, options?: AngularBatcherOptions<TValue, TSelected>, selector?: (state: BatcherState<TValue>) => TSelected): AngularBatcher<TValue, TSelected>;
|
|
75
|
-
//#endregion
|
|
76
|
-
export { AngularBatcher, AngularBatcherOptions, injectBatcher };
|
|
77
|
-
//# sourceMappingURL=injectBatcher.d.ts.map
|
|
73
|
+
export declare function injectBatcher<TValue, TSelected = {}>(fn: (items: Array<TValue>) => void, options?: AngularBatcherOptions<TValue, TSelected>, selector?: (state: BatcherState<TValue>) => TSelected): AngularBatcher<TValue, TSelected>;
|
|
74
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DebouncerOptions } from "@tanstack/pacer/debouncer";
|
|
2
2
|
import { AnyFunction } from "@tanstack/pacer/types";
|
|
3
|
-
|
|
4
3
|
//#region src/debouncer/injectDebouncedCallback.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* An Angular function that creates a debounced version of a callback function.
|
|
@@ -37,7 +36,5 @@ import { AnyFunction } from "@tanstack/pacer/types";
|
|
|
37
36
|
* />
|
|
38
37
|
* ```
|
|
39
38
|
*/
|
|
40
|
-
declare function injectDebouncedCallback<TFn extends AnyFunction>(fn: TFn, options: DebouncerOptions<TFn>): (...args: Parameters<TFn>) => void;
|
|
41
|
-
//#endregion
|
|
42
|
-
export { injectDebouncedCallback };
|
|
43
|
-
//# sourceMappingURL=injectDebouncedCallback.d.ts.map
|
|
39
|
+
export declare function injectDebouncedCallback<TFn extends AnyFunction>(fn: TFn, options: DebouncerOptions<TFn>): (...args: Parameters<TFn>) => void;
|
|
40
|
+
//#endregion
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { AngularDebouncer } from "./injectDebouncer.js";
|
|
2
2
|
import { DebouncerOptions, DebouncerState } from "@tanstack/pacer/debouncer";
|
|
3
|
-
|
|
4
3
|
//#region src/debouncer/injectDebouncedSignal.d.ts
|
|
5
4
|
type Setter<T> = (value: T | ((prev: T) => T)) => void;
|
|
6
|
-
interface DebouncedSignal<TValue, TSelected = {}> {
|
|
5
|
+
export interface DebouncedSignal<TValue, TSelected = {}> {
|
|
7
6
|
(): TValue;
|
|
8
7
|
set: Setter<TValue>;
|
|
9
8
|
debouncer: AngularDebouncer<Setter<TValue>, TSelected>;
|
|
@@ -54,7 +53,5 @@ interface DebouncedSignal<TValue, TSelected = {}> {
|
|
|
54
53
|
* console.log(debouncedQuery.debouncer.state().isPending)
|
|
55
54
|
* ```
|
|
56
55
|
*/
|
|
57
|
-
declare function injectDebouncedSignal<TValue, TSelected = {}>(value: TValue, initialOptions: DebouncerOptions<Setter<TValue>>, selector?: (state: DebouncerState<Setter<TValue>>) => TSelected): DebouncedSignal<TValue, TSelected>;
|
|
58
|
-
//#endregion
|
|
59
|
-
export { DebouncedSignal, injectDebouncedSignal };
|
|
60
|
-
//# sourceMappingURL=injectDebouncedSignal.d.ts.map
|
|
56
|
+
export declare function injectDebouncedSignal<TValue, TSelected = {}>(value: TValue, initialOptions: DebouncerOptions<Setter<TValue>>, selector?: (state: DebouncerState<Setter<TValue>>) => TSelected): DebouncedSignal<TValue, TSelected>;
|
|
57
|
+
//#endregion
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DebouncedSignal } from "./injectDebouncedSignal.js";
|
|
2
2
|
import { Signal } from "@angular/core";
|
|
3
3
|
import { DebouncerOptions, DebouncerState } from "@tanstack/pacer/debouncer";
|
|
4
|
-
|
|
5
4
|
//#region src/debouncer/injectDebouncedValue.d.ts
|
|
6
5
|
type Setter<T> = (value: T | ((prev: T) => T)) => void;
|
|
7
6
|
/**
|
|
@@ -69,8 +68,6 @@ type Setter<T> = (value: T | ((prev: T) => T)) => void;
|
|
|
69
68
|
* debounced.cancel() // Cancel any pending updates
|
|
70
69
|
* ```
|
|
71
70
|
*/
|
|
72
|
-
declare function injectDebouncedValue<TValue, TSelected = {}>(value: Signal<TValue>, initialOptions: DebouncerOptions<Setter<TValue>>, selector?: (state: DebouncerState<Setter<TValue>>) => TSelected): DebouncedSignal<TValue, TSelected>;
|
|
73
|
-
declare function injectDebouncedValue<TValue, TSelected = {}>(value: Signal<TValue>, initialValue: TValue, initialOptions: DebouncerOptions<Setter<TValue>>, selector?: (state: DebouncerState<Setter<TValue>>) => TSelected): DebouncedSignal<TValue, TSelected>;
|
|
74
|
-
//#endregion
|
|
75
|
-
export { injectDebouncedValue };
|
|
76
|
-
//# sourceMappingURL=injectDebouncedValue.d.ts.map
|
|
71
|
+
export declare function injectDebouncedValue<TValue, TSelected = {}>(value: Signal<TValue>, initialOptions: DebouncerOptions<Setter<TValue>>, selector?: (state: DebouncerState<Setter<TValue>>) => TSelected): DebouncedSignal<TValue, TSelected>;
|
|
72
|
+
export declare function injectDebouncedValue<TValue, TSelected = {}>(value: Signal<TValue>, initialValue: TValue, initialOptions: DebouncerOptions<Setter<TValue>>, selector?: (state: DebouncerState<Setter<TValue>>) => TSelected): DebouncedSignal<TValue, TSelected>;
|
|
73
|
+
//#endregion
|
|
@@ -2,16 +2,15 @@ import { Signal } from "@angular/core";
|
|
|
2
2
|
import { Store } from "@tanstack/angular-store";
|
|
3
3
|
import { Debouncer, DebouncerOptions, DebouncerState } from "@tanstack/pacer/debouncer";
|
|
4
4
|
import { AnyFunction } from "@tanstack/pacer/types";
|
|
5
|
-
|
|
6
5
|
//#region src/debouncer/injectDebouncer.d.ts
|
|
7
|
-
interface AngularDebouncerOptions<TFn extends AnyFunction, TSelected = {}> extends DebouncerOptions<TFn> {
|
|
6
|
+
export interface AngularDebouncerOptions<TFn extends AnyFunction, TSelected = {}> extends DebouncerOptions<TFn> {
|
|
8
7
|
/**
|
|
9
8
|
* Optional callback invoked when the component is destroyed. Receives the debouncer instance.
|
|
10
9
|
* When provided, replaces the default cleanup (cancel); use it to call flush(), cancel(), add logging, etc.
|
|
11
10
|
*/
|
|
12
11
|
onUnmount?: (debouncer: AngularDebouncer<TFn, TSelected>) => void;
|
|
13
12
|
}
|
|
14
|
-
interface AngularDebouncer<TFn extends AnyFunction, TSelected = {}> extends Omit<Debouncer<TFn>, 'store'> {
|
|
13
|
+
export interface AngularDebouncer<TFn extends AnyFunction, TSelected = {}> extends Omit<Debouncer<TFn>, 'store'> {
|
|
15
14
|
/**
|
|
16
15
|
* Reactive state signal that will be updated when the debouncer state changes
|
|
17
16
|
*
|
|
@@ -92,7 +91,5 @@ interface AngularDebouncer<TFn extends AnyFunction, TSelected = {}> extends Omit
|
|
|
92
91
|
* const { isPending } = debouncer.state();
|
|
93
92
|
* ```
|
|
94
93
|
*/
|
|
95
|
-
declare function injectDebouncer<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: AngularDebouncerOptions<TFn, TSelected>, selector?: (state: DebouncerState<TFn>) => TSelected): AngularDebouncer<TFn, TSelected>;
|
|
96
|
-
//#endregion
|
|
97
|
-
export { AngularDebouncer, AngularDebouncerOptions, injectDebouncer };
|
|
98
|
-
//# sourceMappingURL=injectDebouncer.d.ts.map
|
|
94
|
+
export declare function injectDebouncer<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: AngularDebouncerOptions<TFn, TSelected>, selector?: (state: DebouncerState<TFn>) => TSelected): AngularDebouncer<TFn, TSelected>;
|
|
95
|
+
//#endregion
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { AnyAsyncFunction, AnyFunction, AsyncBatcherOptions, AsyncDebouncerOptions, AsyncQueuerOptions, AsyncRateLimiterOptions, AsyncThrottlerOptions, BatcherOptions, DebouncerOptions, QueuerOptions, RateLimiterOptions, ThrottlerOptions } from "@tanstack/pacer";
|
|
2
2
|
import { InjectionToken } from "@angular/core";
|
|
3
|
-
|
|
4
3
|
//#region src/provider/pacer-context.d.ts
|
|
5
|
-
interface PacerProviderOptions {
|
|
4
|
+
export interface PacerProviderOptions {
|
|
6
5
|
asyncBatcher?: Partial<AsyncBatcherOptions<any>>;
|
|
7
6
|
asyncDebouncer?: Partial<AsyncDebouncerOptions<AnyAsyncFunction>>;
|
|
8
7
|
asyncQueuer?: Partial<AsyncQueuerOptions<any>>;
|
|
@@ -14,8 +13,6 @@ interface PacerProviderOptions {
|
|
|
14
13
|
rateLimiter?: Partial<RateLimiterOptions<AnyFunction>>;
|
|
15
14
|
throttler?: Partial<ThrottlerOptions<AnyFunction>>;
|
|
16
15
|
}
|
|
17
|
-
declare const PACER_OPTIONS: InjectionToken<PacerProviderOptions>;
|
|
18
|
-
declare function injectPacerOptions(): PacerProviderOptions;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { PACER_OPTIONS, PacerProviderOptions, injectPacerOptions };
|
|
21
|
-
//# sourceMappingURL=pacer-context.d.ts.map
|
|
16
|
+
export declare const PACER_OPTIONS: InjectionToken<PacerProviderOptions>;
|
|
17
|
+
export declare function injectPacerOptions(): PacerProviderOptions;
|
|
18
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PacerProviderOptions } from "./pacer-context.js";
|
|
2
2
|
import { Provider } from "@angular/core";
|
|
3
|
-
|
|
4
3
|
//#region src/provider/pacer-provider.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Provides default options for all Pacer utilities in the Angular application.
|
|
@@ -30,7 +29,5 @@ import { Provider } from "@angular/core";
|
|
|
30
29
|
* export class AppModule {}
|
|
31
30
|
* ```
|
|
32
31
|
*/
|
|
33
|
-
declare function providePacerOptions(options: PacerProviderOptions): Provider;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { providePacerOptions };
|
|
36
|
-
//# sourceMappingURL=pacer-provider.d.ts.map
|
|
32
|
+
export declare function providePacerOptions(options: PacerProviderOptions): Provider;
|
|
33
|
+
//#endregion
|