@tanstack/preact-pacer 0.22.1 → 0.24.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 +17 -2
- package/dist/async-batcher/useAsyncBatchedCallback.d.ts +2 -5
- package/dist/async-batcher/useAsyncBatchedCallback.js +1 -2
- package/dist/async-batcher/useAsyncBatcher.d.ts +4 -8
- package/dist/async-batcher/useAsyncBatcher.js +1 -3
- package/dist/async-debouncer/useAsyncDebouncedCallback.d.ts +6 -7
- package/dist/async-debouncer/useAsyncDebouncedCallback.js +5 -4
- package/dist/async-debouncer/useAsyncDebouncer.d.ts +4 -7
- package/dist/async-debouncer/useAsyncDebouncer.js +1 -2
- package/dist/async-queuer/useAsyncQueuedState.d.ts +4 -7
- package/dist/async-queuer/useAsyncQueuedState.js +3 -4
- package/dist/async-queuer/useAsyncQueuer.d.ts +6 -9
- package/dist/async-queuer/useAsyncQueuer.js +3 -4
- package/dist/async-rate-limiter/useAsyncRateLimitedCallback.d.ts +2 -5
- package/dist/async-rate-limiter/useAsyncRateLimitedCallback.js +1 -2
- package/dist/async-rate-limiter/useAsyncRateLimiter.d.ts +4 -7
- package/dist/async-rate-limiter/useAsyncRateLimiter.js +1 -2
- package/dist/async-throttler/useAsyncThrottledCallback.d.ts +7 -9
- package/dist/async-throttler/useAsyncThrottledCallback.js +6 -6
- package/dist/async-throttler/useAsyncThrottler.d.ts +4 -7
- package/dist/async-throttler/useAsyncThrottler.js +1 -2
- package/dist/batcher/useBatchedCallback.d.ts +2 -5
- package/dist/batcher/useBatchedCallback.js +1 -2
- package/dist/batcher/useBatcher.d.ts +6 -11
- package/dist/batcher/useBatcher.js +3 -6
- package/dist/debouncer/useDebouncedCallback.d.ts +2 -5
- package/dist/debouncer/useDebouncedCallback.js +1 -2
- package/dist/debouncer/useDebouncedState.d.ts +2 -5
- package/dist/debouncer/useDebouncedState.js +1 -2
- package/dist/debouncer/useDebouncedValue.d.ts +2 -5
- package/dist/debouncer/useDebouncedValue.js +1 -2
- package/dist/debouncer/useDebouncer.d.ts +4 -7
- package/dist/debouncer/useDebouncer.js +1 -2
- package/dist/provider/PacerProvider.d.ts +6 -13
- package/dist/provider/PacerProvider.js +1 -2
- package/dist/queuer/useQueuedState.d.ts +2 -5
- package/dist/queuer/useQueuedState.js +1 -2
- package/dist/queuer/useQueuedValue.d.ts +2 -5
- package/dist/queuer/useQueuedValue.js +1 -2
- package/dist/queuer/useQueuer.d.ts +4 -7
- package/dist/queuer/useQueuer.js +1 -2
- package/dist/rate-limiter/useRateLimitedCallback.d.ts +2 -5
- package/dist/rate-limiter/useRateLimitedCallback.js +1 -2
- package/dist/rate-limiter/useRateLimitedState.d.ts +2 -5
- package/dist/rate-limiter/useRateLimitedState.js +1 -2
- package/dist/rate-limiter/useRateLimitedValue.d.ts +2 -5
- package/dist/rate-limiter/useRateLimitedValue.js +1 -2
- package/dist/rate-limiter/useRateLimiter.d.ts +4 -7
- package/dist/rate-limiter/useRateLimiter.js +1 -2
- package/dist/throttler/useThrottledCallback.d.ts +2 -5
- package/dist/throttler/useThrottledCallback.js +1 -2
- package/dist/throttler/useThrottledState.d.ts +2 -5
- package/dist/throttler/useThrottledState.js +1 -2
- package/dist/throttler/useThrottledValue.d.ts +2 -5
- package/dist/throttler/useThrottledValue.js +1 -2
- package/dist/throttler/useThrottler.d.ts +4 -7
- package/dist/throttler/useThrottler.js +1 -2
- package/package.json +24 -72
- package/dist/async-batcher/index.cjs +0 -13
- package/dist/async-batcher/index.d.cts +0 -4
- package/dist/async-batcher/useAsyncBatchedCallback.cjs +0 -51
- package/dist/async-batcher/useAsyncBatchedCallback.cjs.map +0 -1
- package/dist/async-batcher/useAsyncBatchedCallback.d.cts +0 -44
- package/dist/async-batcher/useAsyncBatchedCallback.js.map +0 -1
- package/dist/async-batcher/useAsyncBatcher.cjs +0 -217
- package/dist/async-batcher/useAsyncBatcher.cjs.map +0 -1
- package/dist/async-batcher/useAsyncBatcher.d.cts +0 -224
- package/dist/async-batcher/useAsyncBatcher.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/useAsyncDebouncedCallback.cjs +0 -50
- package/dist/async-debouncer/useAsyncDebouncedCallback.cjs.map +0 -1
- package/dist/async-debouncer/useAsyncDebouncedCallback.d.cts +0 -46
- package/dist/async-debouncer/useAsyncDebouncedCallback.js.map +0 -1
- package/dist/async-debouncer/useAsyncDebouncer.cjs +0 -195
- package/dist/async-debouncer/useAsyncDebouncer.cjs.map +0 -1
- package/dist/async-debouncer/useAsyncDebouncer.d.cts +0 -203
- package/dist/async-debouncer/useAsyncDebouncer.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/useAsyncQueuedState.cjs +0 -154
- package/dist/async-queuer/useAsyncQueuedState.cjs.map +0 -1
- package/dist/async-queuer/useAsyncQueuedState.d.cts +0 -151
- package/dist/async-queuer/useAsyncQueuedState.js.map +0 -1
- package/dist/async-queuer/useAsyncQueuer.cjs +0 -217
- package/dist/async-queuer/useAsyncQueuer.cjs.map +0 -1
- package/dist/async-queuer/useAsyncQueuer.d.cts +0 -224
- package/dist/async-queuer/useAsyncQueuer.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/useAsyncRateLimitedCallback.cjs +0 -65
- package/dist/async-rate-limiter/useAsyncRateLimitedCallback.cjs.map +0 -1
- package/dist/async-rate-limiter/useAsyncRateLimitedCallback.d.cts +0 -61
- package/dist/async-rate-limiter/useAsyncRateLimitedCallback.js.map +0 -1
- package/dist/async-rate-limiter/useAsyncRateLimiter.cjs +0 -209
- package/dist/async-rate-limiter/useAsyncRateLimiter.cjs.map +0 -1
- package/dist/async-rate-limiter/useAsyncRateLimiter.d.cts +0 -220
- package/dist/async-rate-limiter/useAsyncRateLimiter.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/useAsyncThrottledCallback.cjs +0 -48
- package/dist/async-throttler/useAsyncThrottledCallback.cjs.map +0 -1
- package/dist/async-throttler/useAsyncThrottledCallback.d.cts +0 -44
- package/dist/async-throttler/useAsyncThrottledCallback.js.map +0 -1
- package/dist/async-throttler/useAsyncThrottler.cjs +0 -206
- package/dist/async-throttler/useAsyncThrottler.cjs.map +0 -1
- package/dist/async-throttler/useAsyncThrottler.d.cts +0 -214
- package/dist/async-throttler/useAsyncThrottler.js.map +0 -1
- package/dist/batcher/index.cjs +0 -13
- package/dist/batcher/index.d.cts +0 -4
- package/dist/batcher/useBatchedCallback.cjs +0 -47
- package/dist/batcher/useBatchedCallback.cjs.map +0 -1
- package/dist/batcher/useBatchedCallback.d.cts +0 -42
- package/dist/batcher/useBatchedCallback.js.map +0 -1
- package/dist/batcher/useBatcher.cjs +0 -165
- package/dist/batcher/useBatcher.cjs.map +0 -1
- package/dist/batcher/useBatcher.d.cts +0 -175
- package/dist/batcher/useBatcher.js.map +0 -1
- package/dist/debouncer/index.cjs +0 -17
- package/dist/debouncer/index.d.cts +0 -6
- package/dist/debouncer/useDebouncedCallback.cjs +0 -48
- package/dist/debouncer/useDebouncedCallback.cjs.map +0 -1
- package/dist/debouncer/useDebouncedCallback.d.cts +0 -44
- package/dist/debouncer/useDebouncedCallback.js.map +0 -1
- package/dist/debouncer/useDebouncedState.cjs +0 -89
- package/dist/debouncer/useDebouncedState.cjs.map +0 -1
- package/dist/debouncer/useDebouncedState.d.cts +0 -81
- package/dist/debouncer/useDebouncedState.js.map +0 -1
- package/dist/debouncer/useDebouncedValue.cjs +0 -96
- package/dist/debouncer/useDebouncedValue.cjs.map +0 -1
- package/dist/debouncer/useDebouncedValue.d.cts +0 -90
- package/dist/debouncer/useDebouncedValue.js.map +0 -1
- package/dist/debouncer/useDebouncer.cjs +0 -141
- package/dist/debouncer/useDebouncer.cjs.map +0 -1
- package/dist/debouncer/useDebouncer.d.cts +0 -152
- package/dist/debouncer/useDebouncer.js.map +0 -1
- package/dist/index.cjs +0 -67
- package/dist/index.d.cts +0 -30
- package/dist/provider/PacerProvider.cjs +0 -26
- package/dist/provider/PacerProvider.cjs.map +0 -1
- package/dist/provider/PacerProvider.d.cts +0 -33
- package/dist/provider/PacerProvider.js.map +0 -1
- package/dist/provider/index.cjs +0 -6
- package/dist/provider/index.d.cts +0 -2
- package/dist/queuer/index.cjs +0 -15
- package/dist/queuer/index.d.cts +0 -5
- package/dist/queuer/useQueuedState.cjs +0 -129
- package/dist/queuer/useQueuedState.cjs.map +0 -1
- package/dist/queuer/useQueuedState.d.cts +0 -122
- package/dist/queuer/useQueuedState.js.map +0 -1
- package/dist/queuer/useQueuedValue.cjs +0 -115
- package/dist/queuer/useQueuedValue.cjs.map +0 -1
- package/dist/queuer/useQueuedValue.d.cts +0 -105
- package/dist/queuer/useQueuedValue.js.map +0 -1
- package/dist/queuer/useQueuer.cjs +0 -176
- package/dist/queuer/useQueuer.cjs.map +0 -1
- package/dist/queuer/useQueuer.d.cts +0 -186
- package/dist/queuer/useQueuer.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/useRateLimitedCallback.cjs +0 -65
- package/dist/rate-limiter/useRateLimitedCallback.cjs.map +0 -1
- package/dist/rate-limiter/useRateLimitedCallback.d.cts +0 -61
- package/dist/rate-limiter/useRateLimitedCallback.js.map +0 -1
- package/dist/rate-limiter/useRateLimitedState.cjs +0 -115
- package/dist/rate-limiter/useRateLimitedState.cjs.map +0 -1
- package/dist/rate-limiter/useRateLimitedState.d.cts +0 -107
- package/dist/rate-limiter/useRateLimitedState.js.map +0 -1
- package/dist/rate-limiter/useRateLimitedValue.cjs +0 -102
- package/dist/rate-limiter/useRateLimitedValue.cjs.map +0 -1
- package/dist/rate-limiter/useRateLimitedValue.d.cts +0 -96
- package/dist/rate-limiter/useRateLimitedValue.js.map +0 -1
- package/dist/rate-limiter/useRateLimiter.cjs +0 -167
- package/dist/rate-limiter/useRateLimiter.cjs.map +0 -1
- package/dist/rate-limiter/useRateLimiter.d.cts +0 -179
- package/dist/rate-limiter/useRateLimiter.js.map +0 -1
- package/dist/throttler/index.cjs +0 -17
- package/dist/throttler/index.d.cts +0 -6
- package/dist/throttler/useThrottledCallback.cjs +0 -49
- package/dist/throttler/useThrottledCallback.cjs.map +0 -1
- package/dist/throttler/useThrottledCallback.d.cts +0 -45
- package/dist/throttler/useThrottledCallback.js.map +0 -1
- package/dist/throttler/useThrottledState.cjs +0 -100
- package/dist/throttler/useThrottledState.cjs.map +0 -1
- package/dist/throttler/useThrottledState.d.cts +0 -92
- package/dist/throttler/useThrottledState.js.map +0 -1
- package/dist/throttler/useThrottledValue.cjs +0 -91
- package/dist/throttler/useThrottledValue.cjs.map +0 -1
- package/dist/throttler/useThrottledValue.d.cts +0 -85
- package/dist/throttler/useThrottledValue.js.map +0 -1
- package/dist/throttler/useThrottler.cjs +0 -146
- package/dist/throttler/useThrottler.cjs.map +0 -1
- package/dist/throttler/useThrottler.d.cts +0 -157
- package/dist/throttler/useThrottler.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/useAsyncBatchedCallback.ts +0 -53
- package/src/async-batcher/useAsyncBatcher.ts +0 -293
- package/src/async-debouncer/index.ts +0 -5
- package/src/async-debouncer/useAsyncDebouncedCallback.ts +0 -54
- package/src/async-debouncer/useAsyncDebouncer.ts +0 -274
- package/src/async-queuer/index.ts +0 -4
- package/src/async-queuer/useAsyncQueuedState.ts +0 -165
- package/src/async-queuer/useAsyncQueuer.ts +0 -293
- package/src/async-rate-limiter/index.ts +0 -5
- package/src/async-rate-limiter/useAsyncRateLimitedCallback.ts +0 -69
- package/src/async-rate-limiter/useAsyncRateLimiter.ts +0 -294
- package/src/async-retryer/index.ts +0 -2
- package/src/async-throttler/index.ts +0 -5
- package/src/async-throttler/useAsyncThrottledCallback.ts +0 -52
- package/src/async-throttler/useAsyncThrottler.ts +0 -285
- package/src/batcher/index.ts +0 -4
- package/src/batcher/useBatchedCallback.ts +0 -46
- package/src/batcher/useBatcher.ts +0 -241
- package/src/debouncer/index.ts +0 -7
- package/src/debouncer/useDebouncedCallback.ts +0 -51
- package/src/debouncer/useDebouncedState.ts +0 -106
- package/src/debouncer/useDebouncedValue.ts +0 -109
- package/src/debouncer/useDebouncer.ts +0 -219
- package/src/index.ts +0 -56
- package/src/provider/PacerProvider.tsx +0 -70
- package/src/provider/index.ts +0 -1
- package/src/queuer/index.ts +0 -5
- package/src/queuer/useQueuedState.ts +0 -133
- package/src/queuer/useQueuedValue.ts +0 -129
- package/src/queuer/useQueuer.ts +0 -251
- package/src/rate-limiter/index.ts +0 -6
- package/src/rate-limiter/useRateLimitedCallback.ts +0 -68
- package/src/rate-limiter/useRateLimitedState.ts +0 -124
- package/src/rate-limiter/useRateLimitedValue.ts +0 -110
- package/src/rate-limiter/useRateLimiter.ts +0 -244
- package/src/throttler/index.ts +0 -7
- package/src/throttler/useThrottledCallback.ts +0 -52
- package/src/throttler/useThrottledState.ts +0 -118
- package/src/throttler/useThrottledValue.ts +0 -104
- package/src/throttler/useThrottler.ts +0 -224
- package/src/types/index.ts +0 -1
- package/src/utils/index.ts +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PreactDebouncer, PreactDebouncerOptions } from "./useDebouncer.js";
|
|
2
2
|
import { Dispatch, StateUpdater } from "preact/hooks";
|
|
3
3
|
import { DebouncerState } from "@tanstack/pacer/debouncer";
|
|
4
|
-
|
|
5
4
|
//#region src/debouncer/useDebouncedState.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* A Preact hook that creates a debounced state value, combining Preact's useState with debouncing functionality.
|
|
@@ -75,7 +74,5 @@ import { DebouncerState } from "@tanstack/pacer/debouncer";
|
|
|
75
74
|
* const { isPending, executionCount } = debouncer.state;
|
|
76
75
|
* ```
|
|
77
76
|
*/
|
|
78
|
-
declare function useDebouncedState<TValue, TSelected = DebouncerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactDebouncerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: DebouncerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, Dispatch<StateUpdater<TValue>>, PreactDebouncer<Dispatch<StateUpdater<TValue>>, TSelected>];
|
|
79
|
-
//#endregion
|
|
80
|
-
export { useDebouncedState };
|
|
81
|
-
//# sourceMappingURL=useDebouncedState.d.ts.map
|
|
77
|
+
export declare function useDebouncedState<TValue, TSelected = DebouncerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactDebouncerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: DebouncerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, Dispatch<StateUpdater<TValue>>, PreactDebouncer<Dispatch<StateUpdater<TValue>>, TSelected>];
|
|
78
|
+
//#endregion
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PreactDebouncer, PreactDebouncerOptions } from "./useDebouncer.js";
|
|
2
2
|
import { Dispatch, StateUpdater } from "preact/hooks";
|
|
3
3
|
import { DebouncerState } from "@tanstack/pacer/debouncer";
|
|
4
|
-
|
|
5
4
|
//#region src/debouncer/useDebouncedValue.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* A Preact hook that creates a debounced value that updates only after a specified delay.
|
|
@@ -84,7 +83,5 @@ import { DebouncerState } from "@tanstack/pacer/debouncer";
|
|
|
84
83
|
* const { isPending, executionCount } = debouncer.state;
|
|
85
84
|
* ```
|
|
86
85
|
*/
|
|
87
|
-
declare function useDebouncedValue<TValue, TSelected = DebouncerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactDebouncerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: DebouncerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, PreactDebouncer<Dispatch<StateUpdater<TValue>>, TSelected>];
|
|
88
|
-
//#endregion
|
|
89
|
-
export { useDebouncedValue };
|
|
90
|
-
//# sourceMappingURL=useDebouncedValue.d.ts.map
|
|
86
|
+
export declare function useDebouncedValue<TValue, TSelected = DebouncerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactDebouncerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: DebouncerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, PreactDebouncer<Dispatch<StateUpdater<TValue>>, TSelected>];
|
|
87
|
+
//#endregion
|
|
@@ -2,16 +2,15 @@ import { ComponentChildren } from "preact";
|
|
|
2
2
|
import { Store } from "@tanstack/preact-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/useDebouncer.d.ts
|
|
7
|
-
interface PreactDebouncerOptions<TFn extends AnyFunction, TSelected = {}> extends DebouncerOptions<TFn> {
|
|
6
|
+
export interface PreactDebouncerOptions<TFn extends AnyFunction, TSelected = {}> extends DebouncerOptions<TFn> {
|
|
8
7
|
/**
|
|
9
8
|
* Optional callback invoked when the component unmounts. Receives the debouncer instance.
|
|
10
9
|
* When provided, replaces the default cleanup (cancel); use it to call flush(), reset(), cancel(), add logging, etc.
|
|
11
10
|
*/
|
|
12
11
|
onUnmount?: (debouncer: PreactDebouncer<TFn, TSelected>) => void;
|
|
13
12
|
}
|
|
14
|
-
interface PreactDebouncer<TFn extends AnyFunction, TSelected = {}> extends Omit<Debouncer<TFn>, 'store'> {
|
|
13
|
+
export interface PreactDebouncer<TFn extends AnyFunction, TSelected = {}> extends Omit<Debouncer<TFn>, 'store'> {
|
|
15
14
|
/**
|
|
16
15
|
* A Preact HOC (Higher Order Component) that allows you to subscribe to the debouncer state.
|
|
17
16
|
*
|
|
@@ -146,7 +145,5 @@ interface PreactDebouncer<TFn extends AnyFunction, TSelected = {}> extends Omit<
|
|
|
146
145
|
* const { isPending } = searchDebouncer.state;
|
|
147
146
|
* ```
|
|
148
147
|
*/
|
|
149
|
-
declare function useDebouncer<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: PreactDebouncerOptions<TFn, TSelected>, selector?: (state: DebouncerState<TFn>) => TSelected): PreactDebouncer<TFn, TSelected>;
|
|
150
|
-
//#endregion
|
|
151
|
-
export { PreactDebouncer, PreactDebouncerOptions, useDebouncer };
|
|
152
|
-
//# sourceMappingURL=useDebouncer.d.ts.map
|
|
148
|
+
export declare function useDebouncer<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: PreactDebouncerOptions<TFn, TSelected>, selector?: (state: DebouncerState<TFn>) => TSelected): PreactDebouncer<TFn, TSelected>;
|
|
149
|
+
//#endregion
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { AnyAsyncFunction, AnyFunction, AsyncBatcherOptions, AsyncDebouncerOptions, AsyncQueuerOptions, AsyncRateLimiterOptions, AsyncThrottlerOptions, BatcherOptions, DebouncerOptions, QueuerOptions, RateLimiterOptions, ThrottlerOptions } from "@tanstack/pacer";
|
|
2
|
-
import * as _$preact from "preact";
|
|
3
2
|
import { ComponentChildren } from "preact";
|
|
4
|
-
|
|
5
3
|
//#region src/provider/PacerProvider.d.ts
|
|
6
|
-
interface PacerProviderOptions {
|
|
4
|
+
export interface PacerProviderOptions {
|
|
7
5
|
asyncBatcher?: Partial<AsyncBatcherOptions<any>>;
|
|
8
6
|
asyncDebouncer?: Partial<AsyncDebouncerOptions<AnyAsyncFunction>>;
|
|
9
7
|
asyncQueuer?: Partial<AsyncQueuerOptions<any>>;
|
|
@@ -18,16 +16,11 @@ interface PacerProviderOptions {
|
|
|
18
16
|
interface PacerContextValue {
|
|
19
17
|
defaultOptions: PacerProviderOptions;
|
|
20
18
|
}
|
|
21
|
-
interface PacerProviderProps {
|
|
19
|
+
export interface PacerProviderProps {
|
|
22
20
|
children: ComponentChildren;
|
|
23
21
|
defaultOptions?: PacerProviderOptions;
|
|
24
22
|
}
|
|
25
|
-
declare function PacerProvider({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
declare function usePacerContext(): PacerContextValue | null;
|
|
30
|
-
declare function useDefaultPacerOptions(): PacerProviderOptions;
|
|
31
|
-
//#endregion
|
|
32
|
-
export { PacerProvider, PacerProviderOptions, PacerProviderProps, useDefaultPacerOptions, usePacerContext };
|
|
33
|
-
//# sourceMappingURL=PacerProvider.d.ts.map
|
|
23
|
+
export declare function PacerProvider({ children, defaultOptions }: PacerProviderProps): import("preact").JSX.Element;
|
|
24
|
+
export declare function usePacerContext(): PacerContextValue | null;
|
|
25
|
+
export declare function useDefaultPacerOptions(): PacerProviderOptions;
|
|
26
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PreactQueuer, PreactQueuerOptions } from "./useQueuer.js";
|
|
2
2
|
import { Queuer, QueuerState } from "@tanstack/pacer/queuer";
|
|
3
|
-
|
|
4
3
|
//#region src/queuer/useQueuedState.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* A Preact hook that creates a queuer with managed state, combining Preact's useState with queuing functionality.
|
|
@@ -116,7 +115,5 @@ import { Queuer, QueuerState } from "@tanstack/pacer/queuer";
|
|
|
116
115
|
* const { size, isRunning, executionCount } = queue.state;
|
|
117
116
|
* ```
|
|
118
117
|
*/
|
|
119
|
-
declare function useQueuedState<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(fn: (item: TValue) => void, options?: PreactQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): [Array<TValue>, Queuer<TValue>['addItem'], PreactQueuer<TValue, TSelected>];
|
|
120
|
-
//#endregion
|
|
121
|
-
export { useQueuedState };
|
|
122
|
-
//# sourceMappingURL=useQueuedState.d.ts.map
|
|
118
|
+
export declare function useQueuedState<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(fn: (item: TValue) => void, options?: PreactQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): [Array<TValue>, Queuer<TValue>['addItem'], PreactQueuer<TValue, TSelected>];
|
|
119
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PreactQueuer, PreactQueuerOptions } from "./useQueuer.js";
|
|
2
2
|
import { QueuerState } from "@tanstack/pacer/queuer";
|
|
3
|
-
|
|
4
3
|
//#region src/queuer/useQueuedValue.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* A Preact hook that creates a queued value that processes state changes in order with an optional delay.
|
|
@@ -99,7 +98,5 @@ import { QueuerState } from "@tanstack/pacer/queuer";
|
|
|
99
98
|
* const { size, isRunning, executionCount } = queuer.state;
|
|
100
99
|
* ```
|
|
101
100
|
*/
|
|
102
|
-
declare function useQueuedValue<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(initialValue: TValue, options?: PreactQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): [TValue, PreactQueuer<TValue, TSelected>];
|
|
103
|
-
//#endregion
|
|
104
|
-
export { useQueuedValue };
|
|
105
|
-
//# sourceMappingURL=useQueuedValue.d.ts.map
|
|
101
|
+
export declare function useQueuedValue<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(initialValue: TValue, options?: PreactQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): [TValue, PreactQueuer<TValue, TSelected>];
|
|
102
|
+
//#endregion
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { ComponentChildren } from "preact";
|
|
2
2
|
import { Store } from "@tanstack/preact-store";
|
|
3
3
|
import { Queuer, QueuerOptions, QueuerState } from "@tanstack/pacer/queuer";
|
|
4
|
-
|
|
5
4
|
//#region src/queuer/useQueuer.d.ts
|
|
6
|
-
interface PreactQueuerOptions<TValue, TSelected = {}> extends QueuerOptions<TValue> {
|
|
5
|
+
export interface PreactQueuerOptions<TValue, TSelected = {}> extends QueuerOptions<TValue> {
|
|
7
6
|
/**
|
|
8
7
|
* Optional callback invoked when the component unmounts. Receives the queuer instance.
|
|
9
8
|
* When provided, replaces the default cleanup (stop); use it to call flush(), flushAsBatch(), stop(), add logging, etc.
|
|
10
9
|
*/
|
|
11
10
|
onUnmount?: (queuer: PreactQueuer<TValue, TSelected>) => void;
|
|
12
11
|
}
|
|
13
|
-
interface PreactQueuer<TValue, TSelected = {}> extends Omit<Queuer<TValue>, 'store'> {
|
|
12
|
+
export interface PreactQueuer<TValue, TSelected = {}> extends Omit<Queuer<TValue>, 'store'> {
|
|
14
13
|
/**
|
|
15
14
|
* A Preact HOC (Higher Order Component) that allows you to subscribe to the queuer state.
|
|
16
15
|
*
|
|
@@ -180,7 +179,5 @@ interface PreactQueuer<TValue, TSelected = {}> extends Omit<Queuer<TValue>, 'sto
|
|
|
180
179
|
* const { size, isRunning, executionCount } = queue.state;
|
|
181
180
|
* ```
|
|
182
181
|
*/
|
|
183
|
-
declare function useQueuer<TValue, TSelected = {}>(fn: (item: TValue) => void, options?: PreactQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): PreactQueuer<TValue, TSelected>;
|
|
184
|
-
//#endregion
|
|
185
|
-
export { PreactQueuer, PreactQueuerOptions, useQueuer };
|
|
186
|
-
//# sourceMappingURL=useQueuer.d.ts.map
|
|
182
|
+
export declare function useQueuer<TValue, TSelected = {}>(fn: (item: TValue) => void, options?: PreactQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): PreactQueuer<TValue, TSelected>;
|
|
183
|
+
//#endregion
|
package/dist/queuer/useQueuer.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PreactRateLimiterOptions } from "./useRateLimiter.js";
|
|
2
2
|
import { AnyFunction } from "@tanstack/pacer/types";
|
|
3
|
-
|
|
4
3
|
//#region src/rate-limiter/useRateLimitedCallback.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* A Preact hook that creates a rate-limited version of a callback function.
|
|
@@ -55,7 +54,5 @@ import { AnyFunction } from "@tanstack/pacer/types";
|
|
|
55
54
|
* );
|
|
56
55
|
* ```
|
|
57
56
|
*/
|
|
58
|
-
declare function useRateLimitedCallback<TFn extends AnyFunction>(fn: TFn, options: PreactRateLimiterOptions<TFn, {}>): (...args: Parameters<TFn>) => boolean;
|
|
59
|
-
//#endregion
|
|
60
|
-
export { useRateLimitedCallback };
|
|
61
|
-
//# sourceMappingURL=useRateLimitedCallback.d.ts.map
|
|
57
|
+
export declare function useRateLimitedCallback<TFn extends AnyFunction>(fn: TFn, options: PreactRateLimiterOptions<TFn, {}>): (...args: Parameters<TFn>) => boolean;
|
|
58
|
+
//#endregion
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PreactRateLimiter, PreactRateLimiterOptions } from "./useRateLimiter.js";
|
|
2
2
|
import { Dispatch, StateUpdater } from "preact/hooks";
|
|
3
3
|
import { RateLimiterState } from "@tanstack/pacer/rate-limiter";
|
|
4
|
-
|
|
5
4
|
//#region src/rate-limiter/useRateLimitedState.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* A Preact hook that creates a rate-limited state value that enforces a hard limit on state updates within a time window.
|
|
@@ -101,7 +100,5 @@ import { RateLimiterState } from "@tanstack/pacer/rate-limiter";
|
|
|
101
100
|
* const { executionCount, rejectionCount } = rateLimiter.state;
|
|
102
101
|
* ```
|
|
103
102
|
*/
|
|
104
|
-
declare function useRateLimitedState<TValue, TSelected = RateLimiterState>(value: TValue, options: PreactRateLimiterOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: RateLimiterState) => TSelected): [TValue, Dispatch<StateUpdater<TValue>>, PreactRateLimiter<Dispatch<StateUpdater<TValue>>, TSelected>];
|
|
105
|
-
//#endregion
|
|
106
|
-
export { useRateLimitedState };
|
|
107
|
-
//# sourceMappingURL=useRateLimitedState.d.ts.map
|
|
103
|
+
export declare function useRateLimitedState<TValue, TSelected = RateLimiterState>(value: TValue, options: PreactRateLimiterOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: RateLimiterState) => TSelected): [TValue, Dispatch<StateUpdater<TValue>>, PreactRateLimiter<Dispatch<StateUpdater<TValue>>, TSelected>];
|
|
104
|
+
//#endregion
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PreactRateLimiter, PreactRateLimiterOptions } from "./useRateLimiter.js";
|
|
2
2
|
import { Dispatch, StateUpdater } from "preact/hooks";
|
|
3
3
|
import { RateLimiterState } from "@tanstack/pacer/rate-limiter";
|
|
4
|
-
|
|
5
4
|
//#region src/rate-limiter/useRateLimitedValue.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* A high-level Preact hook that creates a rate-limited version of a value that updates at most a certain number of times within a time window.
|
|
@@ -90,7 +89,5 @@ import { RateLimiterState } from "@tanstack/pacer/rate-limiter";
|
|
|
90
89
|
* const { executionCount, rejectionCount } = rateLimiter.state;
|
|
91
90
|
* ```
|
|
92
91
|
*/
|
|
93
|
-
declare function useRateLimitedValue<TValue, TSelected = RateLimiterState>(value: TValue, options: PreactRateLimiterOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: RateLimiterState) => TSelected): [TValue, PreactRateLimiter<Dispatch<StateUpdater<TValue>>, TSelected>];
|
|
94
|
-
//#endregion
|
|
95
|
-
export { useRateLimitedValue };
|
|
96
|
-
//# sourceMappingURL=useRateLimitedValue.d.ts.map
|
|
92
|
+
export declare function useRateLimitedValue<TValue, TSelected = RateLimiterState>(value: TValue, options: PreactRateLimiterOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: RateLimiterState) => TSelected): [TValue, PreactRateLimiter<Dispatch<StateUpdater<TValue>>, TSelected>];
|
|
93
|
+
//#endregion
|
|
@@ -2,16 +2,15 @@ import { ComponentChildren } from "preact";
|
|
|
2
2
|
import { Store } from "@tanstack/preact-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/useRateLimiter.d.ts
|
|
7
|
-
interface PreactRateLimiterOptions<TFn extends AnyFunction, TSelected = {}> extends RateLimiterOptions<TFn> {
|
|
6
|
+
export interface PreactRateLimiterOptions<TFn extends AnyFunction, TSelected = {}> extends RateLimiterOptions<TFn> {
|
|
8
7
|
/**
|
|
9
8
|
* Optional callback invoked when the component unmounts. Receives the rate limiter instance.
|
|
10
9
|
* When provided, replaces the default cleanup; use it to call reset(), add logging, etc.
|
|
11
10
|
*/
|
|
12
11
|
onUnmount?: (rateLimiter: PreactRateLimiter<TFn, TSelected>) => void;
|
|
13
12
|
}
|
|
14
|
-
interface PreactRateLimiter<TFn extends AnyFunction, TSelected = {}> extends Omit<RateLimiter<TFn>, 'store'> {
|
|
13
|
+
export interface PreactRateLimiter<TFn extends AnyFunction, TSelected = {}> extends Omit<RateLimiter<TFn>, 'store'> {
|
|
15
14
|
/**
|
|
16
15
|
* A Preact HOC (Higher Order Component) that allows you to subscribe to the rate limiter state.
|
|
17
16
|
*
|
|
@@ -173,7 +172,5 @@ interface PreactRateLimiter<TFn extends AnyFunction, TSelected = {}> extends Omi
|
|
|
173
172
|
* const { executionCount, rejectionCount } = rateLimiter.state;
|
|
174
173
|
* ```
|
|
175
174
|
*/
|
|
176
|
-
declare function useRateLimiter<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: PreactRateLimiterOptions<TFn, TSelected>, selector?: (state: RateLimiterState) => TSelected): PreactRateLimiter<TFn, TSelected>;
|
|
177
|
-
//#endregion
|
|
178
|
-
export { PreactRateLimiter, PreactRateLimiterOptions, useRateLimiter };
|
|
179
|
-
//# sourceMappingURL=useRateLimiter.d.ts.map
|
|
175
|
+
export declare function useRateLimiter<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: PreactRateLimiterOptions<TFn, TSelected>, selector?: (state: RateLimiterState) => TSelected): PreactRateLimiter<TFn, TSelected>;
|
|
176
|
+
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PreactThrottlerOptions } from "./useThrottler.js";
|
|
2
2
|
import { AnyFunction } from "@tanstack/pacer/types";
|
|
3
|
-
|
|
4
3
|
//#region src/throttler/useThrottledCallback.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* A Preact hook that creates a throttled version of a callback function.
|
|
@@ -39,7 +38,5 @@ import { AnyFunction } from "@tanstack/pacer/types";
|
|
|
39
38
|
* }, [handleResize]);
|
|
40
39
|
* ```
|
|
41
40
|
*/
|
|
42
|
-
declare function useThrottledCallback<TFn extends AnyFunction>(fn: TFn, options: PreactThrottlerOptions<TFn, {}>): (...args: Parameters<TFn>) => void;
|
|
43
|
-
//#endregion
|
|
44
|
-
export { useThrottledCallback };
|
|
45
|
-
//# sourceMappingURL=useThrottledCallback.d.ts.map
|
|
41
|
+
export declare function useThrottledCallback<TFn extends AnyFunction>(fn: TFn, options: PreactThrottlerOptions<TFn, {}>): (...args: Parameters<TFn>) => void;
|
|
42
|
+
//#endregion
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PreactThrottler, PreactThrottlerOptions } from "./useThrottler.js";
|
|
2
2
|
import { Dispatch, StateUpdater } from "preact/hooks";
|
|
3
3
|
import { ThrottlerState } from "@tanstack/pacer/throttler";
|
|
4
|
-
|
|
5
4
|
//#region src/throttler/useThrottledState.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* A Preact hook that creates a throttled state value that updates at most once within a specified time window.
|
|
@@ -86,7 +85,5 @@ import { ThrottlerState } from "@tanstack/pacer/throttler";
|
|
|
86
85
|
* const { executionCount, isPending } = throttler.state;
|
|
87
86
|
* ```
|
|
88
87
|
*/
|
|
89
|
-
declare function useThrottledState<TValue, TSelected = ThrottlerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactThrottlerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: ThrottlerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, Dispatch<StateUpdater<TValue>>, PreactThrottler<Dispatch<StateUpdater<TValue>>, TSelected>];
|
|
90
|
-
//#endregion
|
|
91
|
-
export { useThrottledState };
|
|
92
|
-
//# sourceMappingURL=useThrottledState.d.ts.map
|
|
88
|
+
export declare function useThrottledState<TValue, TSelected = ThrottlerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactThrottlerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: ThrottlerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, Dispatch<StateUpdater<TValue>>, PreactThrottler<Dispatch<StateUpdater<TValue>>, TSelected>];
|
|
89
|
+
//#endregion
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PreactThrottler, PreactThrottlerOptions } from "./useThrottler.js";
|
|
2
2
|
import { Dispatch, StateUpdater } from "preact/hooks";
|
|
3
3
|
import { ThrottlerState } from "@tanstack/pacer/throttler";
|
|
4
|
-
|
|
5
4
|
//#region src/throttler/useThrottledValue.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* A high-level Preact hook that creates a throttled version of a value that updates at most once within a specified time window.
|
|
@@ -79,7 +78,5 @@ import { ThrottlerState } from "@tanstack/pacer/throttler";
|
|
|
79
78
|
* const { executionCount, isPending } = throttler.state;
|
|
80
79
|
* ```
|
|
81
80
|
*/
|
|
82
|
-
declare function useThrottledValue<TValue, TSelected = ThrottlerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactThrottlerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: ThrottlerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, PreactThrottler<Dispatch<StateUpdater<TValue>>, TSelected>];
|
|
83
|
-
//#endregion
|
|
84
|
-
export { useThrottledValue };
|
|
85
|
-
//# sourceMappingURL=useThrottledValue.d.ts.map
|
|
81
|
+
export declare function useThrottledValue<TValue, TSelected = ThrottlerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactThrottlerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: ThrottlerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, PreactThrottler<Dispatch<StateUpdater<TValue>>, TSelected>];
|
|
82
|
+
//#endregion
|
|
@@ -2,16 +2,15 @@ import { ComponentChildren } from "preact";
|
|
|
2
2
|
import { Store } from "@tanstack/preact-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/useThrottler.d.ts
|
|
7
|
-
interface PreactThrottlerOptions<TFn extends AnyFunction, TSelected = {}> extends ThrottlerOptions<TFn> {
|
|
6
|
+
export interface PreactThrottlerOptions<TFn extends AnyFunction, TSelected = {}> extends ThrottlerOptions<TFn> {
|
|
8
7
|
/**
|
|
9
8
|
* Optional callback invoked when the component unmounts. Receives the throttler instance.
|
|
10
9
|
* When provided, replaces the default cleanup (cancel); use it to call flush(), reset(), cancel(), add logging, etc.
|
|
11
10
|
*/
|
|
12
11
|
onUnmount?: (throttler: PreactThrottler<TFn, TSelected>) => void;
|
|
13
12
|
}
|
|
14
|
-
interface PreactThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<Throttler<TFn>, 'store'> {
|
|
13
|
+
export interface PreactThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<Throttler<TFn>, 'store'> {
|
|
15
14
|
/**
|
|
16
15
|
* A Preact HOC (Higher Order Component) that allows you to subscribe to the throttler state.
|
|
17
16
|
*
|
|
@@ -151,7 +150,5 @@ interface PreactThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<
|
|
|
151
150
|
* const { executionCount, isPending } = throttler.state;
|
|
152
151
|
* ```
|
|
153
152
|
*/
|
|
154
|
-
declare function useThrottler<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: PreactThrottlerOptions<TFn, TSelected>, selector?: (state: ThrottlerState<TFn>) => TSelected): PreactThrottler<TFn, TSelected>;
|
|
155
|
-
//#endregion
|
|
156
|
-
export { PreactThrottler, PreactThrottlerOptions, useThrottler };
|
|
157
|
-
//# sourceMappingURL=useThrottler.d.ts.map
|
|
153
|
+
export declare function useThrottler<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: PreactThrottlerOptions<TFn, TSelected>, selector?: (state: ThrottlerState<TFn>) => TSelected): PreactThrottler<TFn, TSelected>;
|
|
154
|
+
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/preact-pacer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "Utilities for debouncing and throttling functions in Preact.",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,88 +23,40 @@
|
|
|
23
23
|
"async"
|
|
24
24
|
],
|
|
25
25
|
"type": "module",
|
|
26
|
-
"types": "./dist/index.d.
|
|
27
|
-
"main": "./dist/index.cjs",
|
|
28
|
-
"module": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
29
27
|
"exports": {
|
|
30
|
-
".":
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"./async-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"./
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"./
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
"./async-rate-limiter": {
|
|
47
|
-
"import": "./dist/async-rate-limiter/index.js",
|
|
48
|
-
"require": "./dist/async-rate-limiter/index.cjs"
|
|
49
|
-
},
|
|
50
|
-
"./async-retryer": {
|
|
51
|
-
"import": "./dist/async-retryer/index.js",
|
|
52
|
-
"require": "./dist/async-retryer/index.cjs"
|
|
53
|
-
},
|
|
54
|
-
"./async-throttler": {
|
|
55
|
-
"import": "./dist/async-throttler/index.js",
|
|
56
|
-
"require": "./dist/async-throttler/index.cjs"
|
|
57
|
-
},
|
|
58
|
-
"./batcher": {
|
|
59
|
-
"import": "./dist/batcher/index.js",
|
|
60
|
-
"require": "./dist/batcher/index.cjs"
|
|
61
|
-
},
|
|
62
|
-
"./debouncer": {
|
|
63
|
-
"import": "./dist/debouncer/index.js",
|
|
64
|
-
"require": "./dist/debouncer/index.cjs"
|
|
65
|
-
},
|
|
66
|
-
"./provider": {
|
|
67
|
-
"import": "./dist/provider/index.js",
|
|
68
|
-
"require": "./dist/provider/index.cjs"
|
|
69
|
-
},
|
|
70
|
-
"./queuer": {
|
|
71
|
-
"import": "./dist/queuer/index.js",
|
|
72
|
-
"require": "./dist/queuer/index.cjs"
|
|
73
|
-
},
|
|
74
|
-
"./rate-limiter": {
|
|
75
|
-
"import": "./dist/rate-limiter/index.js",
|
|
76
|
-
"require": "./dist/rate-limiter/index.cjs"
|
|
77
|
-
},
|
|
78
|
-
"./throttler": {
|
|
79
|
-
"import": "./dist/throttler/index.js",
|
|
80
|
-
"require": "./dist/throttler/index.cjs"
|
|
81
|
-
},
|
|
82
|
-
"./types": {
|
|
83
|
-
"import": "./dist/types/index.js",
|
|
84
|
-
"require": "./dist/types/index.cjs"
|
|
85
|
-
},
|
|
86
|
-
"./utils": {
|
|
87
|
-
"import": "./dist/utils/index.js",
|
|
88
|
-
"require": "./dist/utils/index.cjs"
|
|
89
|
-
},
|
|
28
|
+
".": "./dist/index.js",
|
|
29
|
+
"./async-batcher": "./dist/async-batcher/index.js",
|
|
30
|
+
"./async-debouncer": "./dist/async-debouncer/index.js",
|
|
31
|
+
"./async-queuer": "./dist/async-queuer/index.js",
|
|
32
|
+
"./async-rate-limiter": "./dist/async-rate-limiter/index.js",
|
|
33
|
+
"./async-retryer": "./dist/async-retryer/index.js",
|
|
34
|
+
"./async-throttler": "./dist/async-throttler/index.js",
|
|
35
|
+
"./batcher": "./dist/batcher/index.js",
|
|
36
|
+
"./debouncer": "./dist/debouncer/index.js",
|
|
37
|
+
"./provider": "./dist/provider/index.js",
|
|
38
|
+
"./queuer": "./dist/queuer/index.js",
|
|
39
|
+
"./rate-limiter": "./dist/rate-limiter/index.js",
|
|
40
|
+
"./throttler": "./dist/throttler/index.js",
|
|
41
|
+
"./types": "./dist/types/index.js",
|
|
42
|
+
"./utils": "./dist/utils/index.js",
|
|
90
43
|
"./package.json": "./package.json"
|
|
91
44
|
},
|
|
92
45
|
"sideEffects": false,
|
|
93
46
|
"engines": {
|
|
94
|
-
"node": ">=
|
|
47
|
+
"node": ">=20"
|
|
95
48
|
},
|
|
96
49
|
"files": [
|
|
97
|
-
"dist"
|
|
98
|
-
"src"
|
|
50
|
+
"dist"
|
|
99
51
|
],
|
|
100
52
|
"dependencies": {
|
|
101
|
-
"@tanstack/
|
|
102
|
-
"@tanstack/
|
|
53
|
+
"@tanstack/pacer": "0.23.0",
|
|
54
|
+
"@tanstack/preact-store": "^0.13.3"
|
|
103
55
|
},
|
|
104
56
|
"devDependencies": {
|
|
105
|
-
"@preact/preset-vite": "^2.10.
|
|
57
|
+
"@preact/preset-vite": "^2.10.6",
|
|
106
58
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
107
|
-
"preact": "^10.29.
|
|
59
|
+
"preact": "^10.29.8"
|
|
108
60
|
},
|
|
109
61
|
"peerDependencies": {
|
|
110
62
|
"preact": ">=10.0.0"
|
|
@@ -116,7 +68,7 @@
|
|
|
116
68
|
"test:lib": "vitest --passWithNoTests",
|
|
117
69
|
"test:lib:dev": "pnpm test:lib --watch",
|
|
118
70
|
"test:types": "tsc",
|
|
119
|
-
"test:build": "publint --strict",
|
|
71
|
+
"test:build": "publint --strict && node ../../scripts/verify-package.ts",
|
|
120
72
|
"build": "tsdown"
|
|
121
73
|
}
|
|
122
74
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_useAsyncBatcher = require('./useAsyncBatcher.cjs');
|
|
3
|
-
const require_useAsyncBatchedCallback = require('./useAsyncBatchedCallback.cjs');
|
|
4
|
-
|
|
5
|
-
exports.useAsyncBatchedCallback = require_useAsyncBatchedCallback.useAsyncBatchedCallback;
|
|
6
|
-
exports.useAsyncBatcher = require_useAsyncBatcher.useAsyncBatcher;
|
|
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 { PreactAsyncBatcher, PreactAsyncBatcherOptions, useAsyncBatcher } from "./useAsyncBatcher.cjs";
|
|
2
|
-
import { useAsyncBatchedCallback } from "./useAsyncBatchedCallback.cjs";
|
|
3
|
-
export * from "@tanstack/pacer/async-batcher";
|
|
4
|
-
export { PreactAsyncBatcher, PreactAsyncBatcherOptions, useAsyncBatchedCallback, useAsyncBatcher };
|