@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
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { AngularQueuer } from "./injectQueuer.js";
|
|
2
2
|
import { QueuerOptions, QueuerState } from "@tanstack/pacer/queuer";
|
|
3
|
-
|
|
4
3
|
//#region src/queuer/injectQueuedSignal.d.ts
|
|
5
|
-
interface QueuedSignal<TValue, TSelected = {}> {
|
|
4
|
+
export interface QueuedSignal<TValue, TSelected = {}> {
|
|
6
5
|
(): Array<TValue>;
|
|
7
6
|
addItem: AngularQueuer<TValue, TSelected>['addItem'];
|
|
8
7
|
queuer: AngularQueuer<TValue, TSelected>;
|
|
@@ -38,7 +37,5 @@ interface QueuedSignal<TValue, TSelected = {}> {
|
|
|
38
37
|
* queued.queuer.stop();
|
|
39
38
|
* ```
|
|
40
39
|
*/
|
|
41
|
-
declare function injectQueuedSignal<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(fn: (item: TValue) => void, options?: QueuerOptions<TValue>, selector?: (state: QueuerState<TValue>) => TSelected): QueuedSignal<TValue, TSelected>;
|
|
42
|
-
//#endregion
|
|
43
|
-
export { QueuedSignal, injectQueuedSignal };
|
|
44
|
-
//# sourceMappingURL=injectQueuedSignal.d.ts.map
|
|
40
|
+
export declare function injectQueuedSignal<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(fn: (item: TValue) => void, options?: QueuerOptions<TValue>, selector?: (state: QueuerState<TValue>) => TSelected): QueuedSignal<TValue, TSelected>;
|
|
41
|
+
//#endregion
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { QueuedSignal } from "./injectQueuedSignal.js";
|
|
2
2
|
import { Signal } from "@angular/core";
|
|
3
3
|
import { QueuerOptions, QueuerState } from "@tanstack/pacer/queuer";
|
|
4
|
-
|
|
5
4
|
//#region src/queuer/injectQueuedValue.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* An Angular function that creates a queued value that processes state changes in order with an optional delay.
|
|
@@ -27,8 +26,6 @@ import { QueuerOptions, QueuerState } from "@tanstack/pacer/queuer";
|
|
|
27
26
|
* queued.addItem('new value')
|
|
28
27
|
* ```
|
|
29
28
|
*/
|
|
30
|
-
declare function injectQueuedValue<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(value: Signal<TValue>, options?: QueuerOptions<TValue>, selector?: (state: QueuerState<TValue>) => TSelected): QueuedSignal<TValue, TSelected>;
|
|
31
|
-
declare function injectQueuedValue<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(value: Signal<TValue>, initialValue: TValue, options?: QueuerOptions<TValue>, selector?: (state: QueuerState<TValue>) => TSelected): QueuedSignal<TValue, TSelected>;
|
|
32
|
-
//#endregion
|
|
33
|
-
export { injectQueuedValue };
|
|
34
|
-
//# sourceMappingURL=injectQueuedValue.d.ts.map
|
|
29
|
+
export declare function injectQueuedValue<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(value: Signal<TValue>, options?: QueuerOptions<TValue>, selector?: (state: QueuerState<TValue>) => TSelected): QueuedSignal<TValue, TSelected>;
|
|
30
|
+
export declare function injectQueuedValue<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(value: Signal<TValue>, initialValue: TValue, options?: QueuerOptions<TValue>, selector?: (state: QueuerState<TValue>) => TSelected): QueuedSignal<TValue, TSelected>;
|
|
31
|
+
//#endregion
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { Signal } from "@angular/core";
|
|
2
2
|
import { Store } from "@tanstack/angular-store";
|
|
3
3
|
import { Queuer, QueuerOptions, QueuerState } from "@tanstack/pacer/queuer";
|
|
4
|
-
|
|
5
4
|
//#region src/queuer/injectQueuer.d.ts
|
|
6
|
-
interface AngularQueuerOptions<TValue, TSelected = {}> extends QueuerOptions<TValue> {
|
|
5
|
+
export interface AngularQueuerOptions<TValue, TSelected = {}> extends QueuerOptions<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); use it to call flush(), stop(), add logging, etc.
|
|
10
9
|
*/
|
|
11
10
|
onUnmount?: (queuer: AngularQueuer<TValue, TSelected>) => void;
|
|
12
11
|
}
|
|
13
|
-
interface AngularQueuer<TValue, TSelected = {}> extends Omit<Queuer<TValue>, 'store'> {
|
|
12
|
+
export interface AngularQueuer<TValue, TSelected = {}> extends Omit<Queuer<TValue>, 'store'> {
|
|
14
13
|
/**
|
|
15
14
|
* Reactive state signal that will be updated when the queuer state changes
|
|
16
15
|
*
|
|
@@ -76,7 +75,5 @@ interface AngularQueuer<TValue, TSelected = {}> extends Omit<Queuer<TValue>, 'st
|
|
|
76
75
|
* });
|
|
77
76
|
* ```
|
|
78
77
|
*/
|
|
79
|
-
declare function injectQueuer<TValue, TSelected = {}>(fn: (item: TValue) => void, options?: AngularQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): AngularQueuer<TValue, TSelected>;
|
|
80
|
-
//#endregion
|
|
81
|
-
export { AngularQueuer, AngularQueuerOptions, injectQueuer };
|
|
82
|
-
//# sourceMappingURL=injectQueuer.d.ts.map
|
|
78
|
+
export declare function injectQueuer<TValue, TSelected = {}>(fn: (item: TValue) => void, options?: AngularQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): AngularQueuer<TValue, TSelected>;
|
|
79
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RateLimiterOptions } from "@tanstack/pacer/rate-limiter";
|
|
2
2
|
import { AnyFunction } from "@tanstack/pacer/types";
|
|
3
|
-
|
|
4
3
|
//#region src/rate-limiter/injectRateLimitedCallback.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* An Angular function that creates a rate-limited version of a callback function.
|
|
@@ -36,7 +35,5 @@ import { AnyFunction } from "@tanstack/pacer/types";
|
|
|
36
35
|
* );
|
|
37
36
|
* ```
|
|
38
37
|
*/
|
|
39
|
-
declare function injectRateLimitedCallback<TFn extends AnyFunction>(fn: TFn, options: RateLimiterOptions<TFn>): (...args: Parameters<TFn>) => boolean;
|
|
40
|
-
//#endregion
|
|
41
|
-
export { injectRateLimitedCallback };
|
|
42
|
-
//# sourceMappingURL=injectRateLimitedCallback.d.ts.map
|
|
38
|
+
export declare function injectRateLimitedCallback<TFn extends AnyFunction>(fn: TFn, options: RateLimiterOptions<TFn>): (...args: Parameters<TFn>) => boolean;
|
|
39
|
+
//#endregion
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { AngularRateLimiter } from "./injectRateLimiter.js";
|
|
2
2
|
import { RateLimiterOptions, RateLimiterState } from "@tanstack/pacer/rate-limiter";
|
|
3
|
-
|
|
4
3
|
//#region src/rate-limiter/injectRateLimitedSignal.d.ts
|
|
5
4
|
type Setter<T> = (value: T | ((prev: T) => T)) => void;
|
|
6
|
-
interface RateLimitedSignal<TValue, TSelected = {}> {
|
|
5
|
+
export interface RateLimitedSignal<TValue, TSelected = {}> {
|
|
7
6
|
(): TValue;
|
|
8
7
|
set: Setter<TValue>;
|
|
9
8
|
rateLimiter: AngularRateLimiter<Setter<TValue>, TSelected>;
|
|
@@ -48,7 +47,5 @@ interface RateLimitedSignal<TValue, TSelected = {}> {
|
|
|
48
47
|
* );
|
|
49
48
|
* ```
|
|
50
49
|
*/
|
|
51
|
-
declare function injectRateLimitedSignal<TValue, TSelected = {}>(value: TValue, initialOptions: RateLimiterOptions<Setter<TValue>>, selector?: (state: RateLimiterState) => TSelected): RateLimitedSignal<TValue, TSelected>;
|
|
52
|
-
//#endregion
|
|
53
|
-
export { RateLimitedSignal, injectRateLimitedSignal };
|
|
54
|
-
//# sourceMappingURL=injectRateLimitedSignal.d.ts.map
|
|
50
|
+
export declare function injectRateLimitedSignal<TValue, TSelected = {}>(value: TValue, initialOptions: RateLimiterOptions<Setter<TValue>>, selector?: (state: RateLimiterState) => TSelected): RateLimitedSignal<TValue, TSelected>;
|
|
51
|
+
//#endregion
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { RateLimitedSignal } from "./injectRateLimitedSignal.js";
|
|
2
2
|
import { Signal } from "@angular/core";
|
|
3
3
|
import { RateLimiterOptions, RateLimiterState } from "@tanstack/pacer/rate-limiter";
|
|
4
|
-
|
|
5
4
|
//#region src/rate-limiter/injectRateLimitedValue.d.ts
|
|
6
5
|
type Setter<T> = (value: T | ((prev: T) => T)) => void;
|
|
7
6
|
/**
|
|
@@ -42,8 +41,6 @@ type Setter<T> = (value: T | ((prev: T) => T)) => void;
|
|
|
42
41
|
* })
|
|
43
42
|
* ```
|
|
44
43
|
*/
|
|
45
|
-
declare function injectRateLimitedValue<TValue, TSelected = {}>(value: Signal<TValue>, initialOptions: RateLimiterOptions<Setter<TValue>>, selector?: (state: RateLimiterState) => TSelected): RateLimitedSignal<TValue, TSelected>;
|
|
46
|
-
declare function injectRateLimitedValue<TValue, TSelected = {}>(value: Signal<TValue>, initialValue: TValue, initialOptions: RateLimiterOptions<Setter<TValue>>, selector?: (state: RateLimiterState) => TSelected): RateLimitedSignal<TValue, TSelected>;
|
|
47
|
-
//#endregion
|
|
48
|
-
export { injectRateLimitedValue };
|
|
49
|
-
//# sourceMappingURL=injectRateLimitedValue.d.ts.map
|
|
44
|
+
export declare function injectRateLimitedValue<TValue, TSelected = {}>(value: Signal<TValue>, initialOptions: RateLimiterOptions<Setter<TValue>>, selector?: (state: RateLimiterState) => TSelected): RateLimitedSignal<TValue, TSelected>;
|
|
45
|
+
export declare function injectRateLimitedValue<TValue, TSelected = {}>(value: Signal<TValue>, initialValue: TValue, initialOptions: RateLimiterOptions<Setter<TValue>>, selector?: (state: RateLimiterState) => TSelected): RateLimitedSignal<TValue, TSelected>;
|
|
46
|
+
//#endregion
|
|
@@ -2,15 +2,14 @@ import { Signal } from "@angular/core";
|
|
|
2
2
|
import { Store } from "@tanstack/angular-store";
|
|
3
3
|
import { RateLimiter, RateLimiterOptions, RateLimiterState } from "@tanstack/pacer/rate-limiter";
|
|
4
4
|
import { AnyFunction } from "@tanstack/pacer/types";
|
|
5
|
-
|
|
6
5
|
//#region src/rate-limiter/injectRateLimiter.d.ts
|
|
7
|
-
interface AngularRateLimiterOptions<TFn extends AnyFunction, TSelected = {}> extends RateLimiterOptions<TFn> {
|
|
6
|
+
export interface AngularRateLimiterOptions<TFn extends AnyFunction, TSelected = {}> extends RateLimiterOptions<TFn> {
|
|
8
7
|
/**
|
|
9
8
|
* Optional callback invoked when the component is destroyed. Receives the rate limiter instance.
|
|
10
9
|
*/
|
|
11
10
|
onUnmount?: (rateLimiter: AngularRateLimiter<TFn, TSelected>) => void;
|
|
12
11
|
}
|
|
13
|
-
interface AngularRateLimiter<TFn extends AnyFunction, TSelected = {}> extends Omit<RateLimiter<TFn>, 'store'> {
|
|
12
|
+
export interface AngularRateLimiter<TFn extends AnyFunction, TSelected = {}> extends Omit<RateLimiter<TFn>, 'store'> {
|
|
14
13
|
/**
|
|
15
14
|
* Reactive state signal that will be updated when the rate limiter state changes
|
|
16
15
|
*
|
|
@@ -97,7 +96,5 @@ interface AngularRateLimiter<TFn extends AnyFunction, TSelected = {}> extends Om
|
|
|
97
96
|
* const { executionCount, rejectionCount } = rateLimiter.state();
|
|
98
97
|
* ```
|
|
99
98
|
*/
|
|
100
|
-
declare function injectRateLimiter<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: AngularRateLimiterOptions<TFn, TSelected>, selector?: (state: RateLimiterState) => TSelected): AngularRateLimiter<TFn, TSelected>;
|
|
101
|
-
//#endregion
|
|
102
|
-
export { AngularRateLimiter, AngularRateLimiterOptions, injectRateLimiter };
|
|
103
|
-
//# sourceMappingURL=injectRateLimiter.d.ts.map
|
|
99
|
+
export declare function injectRateLimiter<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: AngularRateLimiterOptions<TFn, TSelected>, selector?: (state: RateLimiterState) => TSelected): AngularRateLimiter<TFn, TSelected>;
|
|
100
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ThrottlerOptions } from "@tanstack/pacer/throttler";
|
|
2
2
|
import { AnyFunction } from "@tanstack/pacer/types";
|
|
3
|
-
|
|
4
3
|
//#region src/throttler/injectThrottledCallback.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* An Angular function that creates a throttled version of a callback function.
|
|
@@ -36,7 +35,5 @@ import { AnyFunction } from "@tanstack/pacer/types";
|
|
|
36
35
|
* });
|
|
37
36
|
* ```
|
|
38
37
|
*/
|
|
39
|
-
declare function injectThrottledCallback<TFn extends AnyFunction>(fn: TFn, options: ThrottlerOptions<TFn>): (...args: Parameters<TFn>) => void;
|
|
40
|
-
//#endregion
|
|
41
|
-
export { injectThrottledCallback };
|
|
42
|
-
//# sourceMappingURL=injectThrottledCallback.d.ts.map
|
|
38
|
+
export declare function injectThrottledCallback<TFn extends AnyFunction>(fn: TFn, options: ThrottlerOptions<TFn>): (...args: Parameters<TFn>) => void;
|
|
39
|
+
//#endregion
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { AngularThrottler } from "./injectThrottler.js";
|
|
2
2
|
import { ThrottlerOptions, ThrottlerState } from "@tanstack/pacer/throttler";
|
|
3
|
-
|
|
4
3
|
//#region src/throttler/injectThrottledSignal.d.ts
|
|
5
4
|
type Setter<T> = (value: T | ((prev: T) => T)) => void;
|
|
6
|
-
interface ThrottledSignal<TValue, TSelected = {}> {
|
|
5
|
+
export interface ThrottledSignal<TValue, TSelected = {}> {
|
|
7
6
|
(): TValue;
|
|
8
7
|
set: Setter<TValue>;
|
|
9
8
|
throttler: AngularThrottler<Setter<TValue>, TSelected>;
|
|
@@ -32,8 +31,6 @@ interface ThrottledSignal<TValue, TSelected = {}> {
|
|
|
32
31
|
* full control over when your component tracks state changes.
|
|
33
32
|
*
|
|
34
33
|
* Available throttler state properties:
|
|
35
|
-
* - `canLeadingExecute`: Whether the throttler can execute on the leading edge
|
|
36
|
-
* - `canTrailingExecute`: Whether the throttler can execute on the trailing edge
|
|
37
34
|
* - `executionCount`: Number of function executions that have been completed
|
|
38
35
|
* - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
|
|
39
36
|
* - `lastArgs`: The arguments from the most recent call to maybeExecute
|
|
@@ -55,7 +52,5 @@ interface ThrottledSignal<TValue, TSelected = {}> {
|
|
|
55
52
|
* console.log(throttledScrollY.throttler.state().isPending)
|
|
56
53
|
* ```
|
|
57
54
|
*/
|
|
58
|
-
declare function injectThrottledSignal<TValue, TSelected = {}>(value: TValue, initialOptions: ThrottlerOptions<Setter<TValue>>, selector?: (state: ThrottlerState<Setter<TValue>>) => TSelected): ThrottledSignal<TValue, TSelected>;
|
|
59
|
-
//#endregion
|
|
60
|
-
export { ThrottledSignal, injectThrottledSignal };
|
|
61
|
-
//# sourceMappingURL=injectThrottledSignal.d.ts.map
|
|
55
|
+
export declare function injectThrottledSignal<TValue, TSelected = {}>(value: TValue, initialOptions: ThrottlerOptions<Setter<TValue>>, selector?: (state: ThrottlerState<Setter<TValue>>) => TSelected): ThrottledSignal<TValue, TSelected>;
|
|
56
|
+
//#endregion
|
|
@@ -26,8 +26,6 @@ import { signal } from "@angular/core";
|
|
|
26
26
|
* full control over when your component tracks state changes.
|
|
27
27
|
*
|
|
28
28
|
* Available throttler state properties:
|
|
29
|
-
* - `canLeadingExecute`: Whether the throttler can execute on the leading edge
|
|
30
|
-
* - `canTrailingExecute`: Whether the throttler can execute on the trailing edge
|
|
31
29
|
* - `executionCount`: Number of function executions that have been completed
|
|
32
30
|
* - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
|
|
33
31
|
* - `lastArgs`: The arguments from the most recent call to maybeExecute
|
|
@@ -65,5 +63,4 @@ function injectThrottledSignal(value, initialOptions, selector) {
|
|
|
65
63
|
}
|
|
66
64
|
|
|
67
65
|
//#endregion
|
|
68
|
-
export { injectThrottledSignal };
|
|
69
|
-
//# sourceMappingURL=injectThrottledSignal.js.map
|
|
66
|
+
export { injectThrottledSignal };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ThrottledSignal } from "./injectThrottledSignal.js";
|
|
2
2
|
import { Signal } from "@angular/core";
|
|
3
3
|
import { ThrottlerOptions, ThrottlerState } from "@tanstack/pacer/throttler";
|
|
4
|
-
|
|
5
4
|
//#region src/throttler/injectThrottledValue.d.ts
|
|
6
5
|
type Setter<T> = (value: T | ((prev: T) => T)) => void;
|
|
7
6
|
/**
|
|
@@ -31,8 +30,6 @@ type Setter<T> = (value: T | ((prev: T) => T)) => void;
|
|
|
31
30
|
* full control over when your component tracks state changes.
|
|
32
31
|
*
|
|
33
32
|
* Available throttler state properties:
|
|
34
|
-
* - `canLeadingExecute`: Whether the throttler can execute on the leading edge
|
|
35
|
-
* - `canTrailingExecute`: Whether the throttler can execute on the trailing edge
|
|
36
33
|
* - `executionCount`: Number of function executions that have been completed
|
|
37
34
|
* - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
|
|
38
35
|
* - `lastArgs`: The arguments from the most recent call to maybeExecute
|
|
@@ -67,8 +64,6 @@ type Setter<T> = (value: T | ((prev: T) => T)) => void;
|
|
|
67
64
|
* throttledScrollY.cancel() // Cancel any pending updates
|
|
68
65
|
* ```
|
|
69
66
|
*/
|
|
70
|
-
declare function injectThrottledValue<TValue, TSelected = {}>(value: Signal<TValue>, initialOptions: ThrottlerOptions<Setter<TValue>>, selector?: (state: ThrottlerState<Setter<TValue>>) => TSelected): ThrottledSignal<TValue, TSelected>;
|
|
71
|
-
declare function injectThrottledValue<TValue, TSelected = {}>(value: Signal<TValue>, initialValue: TValue, initialOptions: ThrottlerOptions<Setter<TValue>>, selector?: (state: ThrottlerState<Setter<TValue>>) => TSelected): ThrottledSignal<TValue, TSelected>;
|
|
72
|
-
//#endregion
|
|
73
|
-
export { injectThrottledValue };
|
|
74
|
-
//# sourceMappingURL=injectThrottledValue.d.ts.map
|
|
67
|
+
export declare function injectThrottledValue<TValue, TSelected = {}>(value: Signal<TValue>, initialOptions: ThrottlerOptions<Setter<TValue>>, selector?: (state: ThrottlerState<Setter<TValue>>) => TSelected): ThrottledSignal<TValue, TSelected>;
|
|
68
|
+
export declare function injectThrottledValue<TValue, TSelected = {}>(value: Signal<TValue>, initialValue: TValue, initialOptions: ThrottlerOptions<Setter<TValue>>, selector?: (state: ThrottlerState<Setter<TValue>>) => TSelected): ThrottledSignal<TValue, TSelected>;
|
|
69
|
+
//#endregion
|
|
@@ -2,16 +2,15 @@ import { Signal } from "@angular/core";
|
|
|
2
2
|
import { Store } from "@tanstack/angular-store";
|
|
3
3
|
import { Throttler, ThrottlerOptions, ThrottlerState } from "@tanstack/pacer/throttler";
|
|
4
4
|
import { AnyFunction } from "@tanstack/pacer/types";
|
|
5
|
-
|
|
6
5
|
//#region src/throttler/injectThrottler.d.ts
|
|
7
|
-
interface AngularThrottlerOptions<TFn extends AnyFunction, TSelected = {}> extends ThrottlerOptions<TFn> {
|
|
6
|
+
export interface AngularThrottlerOptions<TFn extends AnyFunction, TSelected = {}> extends ThrottlerOptions<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); use it to call flush(), cancel(), add logging, etc.
|
|
11
10
|
*/
|
|
12
11
|
onUnmount?: (throttler: AngularThrottler<TFn, TSelected>) => void;
|
|
13
12
|
}
|
|
14
|
-
interface AngularThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<Throttler<TFn>, 'store'> {
|
|
13
|
+
export interface AngularThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<Throttler<TFn>, 'store'> {
|
|
15
14
|
/**
|
|
16
15
|
* Reactive state signal that will be updated when the throttler state changes
|
|
17
16
|
*
|
|
@@ -47,8 +46,6 @@ interface AngularThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit
|
|
|
47
46
|
* full control over when your component tracks state changes.
|
|
48
47
|
*
|
|
49
48
|
* Available state properties:
|
|
50
|
-
* - `canLeadingExecute`: Whether the throttler can execute on the leading edge
|
|
51
|
-
* - `canTrailingExecute`: Whether the throttler can execute on the trailing edge
|
|
52
49
|
* - `executionCount`: Number of function executions that have been completed
|
|
53
50
|
* - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
|
|
54
51
|
* - `lastArgs`: The arguments from the most recent call to maybeExecute
|
|
@@ -92,7 +89,5 @@ interface AngularThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit
|
|
|
92
89
|
* const { isPending } = throttler.state();
|
|
93
90
|
* ```
|
|
94
91
|
*/
|
|
95
|
-
declare function injectThrottler<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: AngularThrottlerOptions<TFn, TSelected>, selector?: (state: ThrottlerState<TFn>) => TSelected): AngularThrottler<TFn, TSelected>;
|
|
96
|
-
//#endregion
|
|
97
|
-
export { AngularThrottler, AngularThrottlerOptions, injectThrottler };
|
|
98
|
-
//# sourceMappingURL=injectThrottler.d.ts.map
|
|
92
|
+
export declare function injectThrottler<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: AngularThrottlerOptions<TFn, TSelected>, selector?: (state: ThrottlerState<TFn>) => TSelected): AngularThrottler<TFn, TSelected>;
|
|
93
|
+
//#endregion
|
|
@@ -27,8 +27,6 @@ import { Throttler } from "@tanstack/pacer/throttler";
|
|
|
27
27
|
* full control over when your component tracks state changes.
|
|
28
28
|
*
|
|
29
29
|
* Available state properties:
|
|
30
|
-
* - `canLeadingExecute`: Whether the throttler can execute on the leading edge
|
|
31
|
-
* - `canTrailingExecute`: Whether the throttler can execute on the trailing edge
|
|
32
30
|
* - `executionCount`: Number of function executions that have been completed
|
|
33
31
|
* - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
|
|
34
32
|
* - `lastArgs`: The arguments from the most recent call to maybeExecute
|
|
@@ -91,5 +89,4 @@ function injectThrottler(fn, options, selector = () => ({})) {
|
|
|
91
89
|
}
|
|
92
90
|
|
|
93
91
|
//#endregion
|
|
94
|
-
export { injectThrottler };
|
|
95
|
-
//# sourceMappingURL=injectThrottler.js.map
|
|
92
|
+
export { injectThrottler };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/angular-pacer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "Utilities for debouncing and throttling functions in Angular.",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,87 +24,39 @@
|
|
|
24
24
|
"signals"
|
|
25
25
|
],
|
|
26
26
|
"type": "module",
|
|
27
|
-
"
|
|
28
|
-
"module": "./dist/index.js",
|
|
29
|
-
"types": "./dist/index.d.cts",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
30
28
|
"exports": {
|
|
31
|
-
".":
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"./async-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"./
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"./
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
"./async-rate-limiter": {
|
|
48
|
-
"import": "./dist/async-rate-limiter/index.js",
|
|
49
|
-
"require": "./dist/async-rate-limiter/index.cjs"
|
|
50
|
-
},
|
|
51
|
-
"./async-retryer": {
|
|
52
|
-
"import": "./dist/async-retryer/index.js",
|
|
53
|
-
"require": "./dist/async-retryer/index.cjs"
|
|
54
|
-
},
|
|
55
|
-
"./async-throttler": {
|
|
56
|
-
"import": "./dist/async-throttler/index.js",
|
|
57
|
-
"require": "./dist/async-throttler/index.cjs"
|
|
58
|
-
},
|
|
59
|
-
"./batcher": {
|
|
60
|
-
"import": "./dist/batcher/index.js",
|
|
61
|
-
"require": "./dist/batcher/index.cjs"
|
|
62
|
-
},
|
|
63
|
-
"./debouncer": {
|
|
64
|
-
"import": "./dist/debouncer/index.js",
|
|
65
|
-
"require": "./dist/debouncer/index.cjs"
|
|
66
|
-
},
|
|
67
|
-
"./provider": {
|
|
68
|
-
"import": "./dist/provider/index.js",
|
|
69
|
-
"require": "./dist/provider/index.cjs"
|
|
70
|
-
},
|
|
71
|
-
"./queuer": {
|
|
72
|
-
"import": "./dist/queuer/index.js",
|
|
73
|
-
"require": "./dist/queuer/index.cjs"
|
|
74
|
-
},
|
|
75
|
-
"./rate-limiter": {
|
|
76
|
-
"import": "./dist/rate-limiter/index.js",
|
|
77
|
-
"require": "./dist/rate-limiter/index.cjs"
|
|
78
|
-
},
|
|
79
|
-
"./throttler": {
|
|
80
|
-
"import": "./dist/throttler/index.js",
|
|
81
|
-
"require": "./dist/throttler/index.cjs"
|
|
82
|
-
},
|
|
83
|
-
"./types": {
|
|
84
|
-
"import": "./dist/types/index.js",
|
|
85
|
-
"require": "./dist/types/index.cjs"
|
|
86
|
-
},
|
|
87
|
-
"./utils": {
|
|
88
|
-
"import": "./dist/utils/index.js",
|
|
89
|
-
"require": "./dist/utils/index.cjs"
|
|
90
|
-
},
|
|
29
|
+
".": "./dist/index.js",
|
|
30
|
+
"./async-batcher": "./dist/async-batcher/index.js",
|
|
31
|
+
"./async-debouncer": "./dist/async-debouncer/index.js",
|
|
32
|
+
"./async-queuer": "./dist/async-queuer/index.js",
|
|
33
|
+
"./async-rate-limiter": "./dist/async-rate-limiter/index.js",
|
|
34
|
+
"./async-retryer": "./dist/async-retryer/index.js",
|
|
35
|
+
"./async-throttler": "./dist/async-throttler/index.js",
|
|
36
|
+
"./batcher": "./dist/batcher/index.js",
|
|
37
|
+
"./debouncer": "./dist/debouncer/index.js",
|
|
38
|
+
"./provider": "./dist/provider/index.js",
|
|
39
|
+
"./queuer": "./dist/queuer/index.js",
|
|
40
|
+
"./rate-limiter": "./dist/rate-limiter/index.js",
|
|
41
|
+
"./throttler": "./dist/throttler/index.js",
|
|
42
|
+
"./types": "./dist/types/index.js",
|
|
43
|
+
"./utils": "./dist/utils/index.js",
|
|
91
44
|
"./package.json": "./package.json"
|
|
92
45
|
},
|
|
93
46
|
"sideEffects": false,
|
|
94
47
|
"engines": {
|
|
95
|
-
"node": ">=
|
|
48
|
+
"node": ">=20"
|
|
96
49
|
},
|
|
97
50
|
"files": [
|
|
98
|
-
"dist"
|
|
99
|
-
"src"
|
|
51
|
+
"dist"
|
|
100
52
|
],
|
|
101
53
|
"dependencies": {
|
|
102
|
-
"@tanstack/angular-store": "^0.11.
|
|
103
|
-
"@tanstack/pacer": "0.
|
|
54
|
+
"@tanstack/angular-store": "^0.11.1",
|
|
55
|
+
"@tanstack/pacer": "0.23.0"
|
|
104
56
|
},
|
|
105
57
|
"devDependencies": {
|
|
106
|
-
"@angular/core": "^
|
|
107
|
-
"@types/node": "^
|
|
58
|
+
"@angular/core": "^22.2.0",
|
|
59
|
+
"@types/node": "^26.6.2"
|
|
108
60
|
},
|
|
109
61
|
"peerDependencies": {
|
|
110
62
|
"@angular/core": ">=17.0.0"
|
|
@@ -116,6 +68,7 @@
|
|
|
116
68
|
"test:lib": "vitest --passWithNoTests",
|
|
117
69
|
"test:lib:dev": "pnpm test:lib --watch",
|
|
118
70
|
"test:types": "tsc",
|
|
119
|
-
"build": "tsdown"
|
|
71
|
+
"build": "tsdown",
|
|
72
|
+
"test:build": "publint --strict && node ../../scripts/verify-package.ts"
|
|
120
73
|
}
|
|
121
74
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_injectAsyncBatcher = require('./injectAsyncBatcher.cjs');
|
|
3
|
-
const require_injectAsyncBatchedCallback = require('./injectAsyncBatchedCallback.cjs');
|
|
4
|
-
|
|
5
|
-
exports.injectAsyncBatchedCallback = require_injectAsyncBatchedCallback.injectAsyncBatchedCallback;
|
|
6
|
-
exports.injectAsyncBatcher = require_injectAsyncBatcher.injectAsyncBatcher;
|
|
7
|
-
var _tanstack_pacer_async_batcher = require("@tanstack/pacer/async-batcher");
|
|
8
|
-
Object.keys(_tanstack_pacer_async_batcher).forEach(function (k) {
|
|
9
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return _tanstack_pacer_async_batcher[k]; }
|
|
12
|
-
});
|
|
13
|
-
});
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { injectAsyncBatchedCallback } from "./injectAsyncBatchedCallback.cjs";
|
|
2
|
-
import { AngularAsyncBatcher, AngularAsyncBatcherOptions, injectAsyncBatcher } from "./injectAsyncBatcher.cjs";
|
|
3
|
-
export * from "@tanstack/pacer/async-batcher";
|
|
4
|
-
export { AngularAsyncBatcher, AngularAsyncBatcherOptions, injectAsyncBatchedCallback, injectAsyncBatcher };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
const require_injectAsyncBatcher = require('./injectAsyncBatcher.cjs');
|
|
2
|
-
|
|
3
|
-
//#region src/async-batcher/injectAsyncBatchedCallback.ts
|
|
4
|
-
/**
|
|
5
|
-
* An Angular function that creates an async batched version of a callback function.
|
|
6
|
-
* This function is essentially a wrapper around `injectAsyncBatcher` that provides
|
|
7
|
-
* a simplified API for basic async batching needs.
|
|
8
|
-
*
|
|
9
|
-
* The batched function will collect items and process them in batches asynchronously based on
|
|
10
|
-
* the configured conditions (maxSize, wait time, etc.).
|
|
11
|
-
*
|
|
12
|
-
* This function provides a simpler API compared to `injectAsyncBatcher`, making it ideal for basic
|
|
13
|
-
* async batching needs. However, it does not expose the underlying AsyncBatcher instance.
|
|
14
|
-
*
|
|
15
|
-
* For advanced usage requiring features like:
|
|
16
|
-
* - Manual flushing
|
|
17
|
-
* - Access to batch state
|
|
18
|
-
* - Error handling callbacks
|
|
19
|
-
* - Retry support
|
|
20
|
-
*
|
|
21
|
-
* Consider using the `injectAsyncBatcher` function instead.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* // Batch async API calls
|
|
26
|
-
* const batchApiCall = injectAsyncBatchedCallback(
|
|
27
|
-
* async (items: Array<Data>) => {
|
|
28
|
-
* const response = await fetch('/api/batch', {
|
|
29
|
-
* method: 'POST',
|
|
30
|
-
* body: JSON.stringify(items)
|
|
31
|
-
* });
|
|
32
|
-
* return response.json();
|
|
33
|
-
* },
|
|
34
|
-
* { maxSize: 10, wait: 1000 }
|
|
35
|
-
* );
|
|
36
|
-
*
|
|
37
|
-
* // Items will be batched and sent together
|
|
38
|
-
* await batchApiCall(data1);
|
|
39
|
-
* await batchApiCall(data2);
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
function injectAsyncBatchedCallback(fn, options) {
|
|
43
|
-
const batcher = require_injectAsyncBatcher.injectAsyncBatcher(fn, options);
|
|
44
|
-
return (item) => batcher.addItem(item);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
//#endregion
|
|
48
|
-
exports.injectAsyncBatchedCallback = injectAsyncBatchedCallback;
|
|
49
|
-
//# sourceMappingURL=injectAsyncBatchedCallback.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"injectAsyncBatchedCallback.cjs","names":["injectAsyncBatcher"],"sources":["../../src/async-batcher/injectAsyncBatchedCallback.ts"],"sourcesContent":["import { injectAsyncBatcher } from './injectAsyncBatcher'\nimport type { AsyncBatcherOptions } from '@tanstack/pacer/async-batcher'\n\n/**\n * An Angular function that creates an async batched version of a callback function.\n * This function is essentially a wrapper around `injectAsyncBatcher` that provides\n * a simplified API for basic async batching needs.\n *\n * The batched function will collect items and process them in batches asynchronously based on\n * the configured conditions (maxSize, wait time, etc.).\n *\n * This function provides a simpler API compared to `injectAsyncBatcher`, making it ideal for basic\n * async batching needs. However, it does not expose the underlying AsyncBatcher instance.\n *\n * For advanced usage requiring features like:\n * - Manual flushing\n * - Access to batch state\n * - Error handling callbacks\n * - Retry support\n *\n * Consider using the `injectAsyncBatcher` function instead.\n *\n * @example\n * ```ts\n * // Batch async API calls\n * const batchApiCall = injectAsyncBatchedCallback(\n * async (items: Array<Data>) => {\n * const response = await fetch('/api/batch', {\n * method: 'POST',\n * body: JSON.stringify(items)\n * });\n * return response.json();\n * },\n * { maxSize: 10, wait: 1000 }\n * );\n *\n * // Items will be batched and sent together\n * await batchApiCall(data1);\n * await batchApiCall(data2);\n * ```\n */\nexport function injectAsyncBatchedCallback<TValue>(\n fn: (items: Array<TValue>) => Promise<any>,\n options: AsyncBatcherOptions<TValue>,\n): (item: TValue) => Promise<void> {\n const batcher = injectAsyncBatcher(fn, options)\n return (item: TValue) => batcher.addItem(item)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAgB,2BACd,IACA,SACiC;CACjC,MAAM,UAAUA,8CAAmB,IAAI,QAAQ;CAC/C,QAAQ,SAAiB,QAAQ,QAAQ,KAAK"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { AsyncBatcherOptions } from "@tanstack/pacer/async-batcher";
|
|
2
|
-
|
|
3
|
-
//#region src/async-batcher/injectAsyncBatchedCallback.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* An Angular function that creates an async batched version of a callback function.
|
|
6
|
-
* This function is essentially a wrapper around `injectAsyncBatcher` that provides
|
|
7
|
-
* a simplified API for basic async batching needs.
|
|
8
|
-
*
|
|
9
|
-
* The batched function will collect items and process them in batches asynchronously based on
|
|
10
|
-
* the configured conditions (maxSize, wait time, etc.).
|
|
11
|
-
*
|
|
12
|
-
* This function provides a simpler API compared to `injectAsyncBatcher`, making it ideal for basic
|
|
13
|
-
* async batching needs. However, it does not expose the underlying AsyncBatcher instance.
|
|
14
|
-
*
|
|
15
|
-
* For advanced usage requiring features like:
|
|
16
|
-
* - Manual flushing
|
|
17
|
-
* - Access to batch state
|
|
18
|
-
* - Error handling callbacks
|
|
19
|
-
* - Retry support
|
|
20
|
-
*
|
|
21
|
-
* Consider using the `injectAsyncBatcher` function instead.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* // Batch async API calls
|
|
26
|
-
* const batchApiCall = injectAsyncBatchedCallback(
|
|
27
|
-
* async (items: Array<Data>) => {
|
|
28
|
-
* const response = await fetch('/api/batch', {
|
|
29
|
-
* method: 'POST',
|
|
30
|
-
* body: JSON.stringify(items)
|
|
31
|
-
* });
|
|
32
|
-
* return response.json();
|
|
33
|
-
* },
|
|
34
|
-
* { maxSize: 10, wait: 1000 }
|
|
35
|
-
* );
|
|
36
|
-
*
|
|
37
|
-
* // Items will be batched and sent together
|
|
38
|
-
* await batchApiCall(data1);
|
|
39
|
-
* await batchApiCall(data2);
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
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.cts.map
|