Framework
Version
Debouncer API Reference
Throttler API Reference
Rate Limiter API Reference
Queue API Reference

AsyncThrottlerOptions

Interface: AsyncThrottlerOptions<TFn, TArgs>

Defined in: async-throttler.ts:6

Options for configuring an async throttled function

Type Parameters

TFn extends AnyAsyncFunction

TArgs extends Parameters<TFn>

Properties

enabled?

ts
optional enabled: boolean;
optional enabled: boolean;

Defined in: async-throttler.ts:14

Whether the throttler is enabled. When disabled, maybeExecute will not trigger any executions. Defaults to true.


onError()?

ts
optional onError: (error) => void;
optional onError: (error) => void;

Defined in: async-throttler.ts:18

Optional error handler for when the throttled function throws

Parameters

error

unknown

Returns

void


onExecute()?

ts
optional onExecute: (throttler) => void;
optional onExecute: (throttler) => void;

Defined in: async-throttler.ts:22

Optional function to call when the throttled function is executed

Parameters

throttler

AsyncThrottler<TFn, TArgs>

Returns

void


wait

ts
wait: number;
wait: number;

Defined in: async-throttler.ts:27

Time window in milliseconds during which the function can only be executed once Defaults to 0ms

Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.