📄 tanstack/pacer/latest/docs/reference/interfaces/AsyncThrottlerOptions

File: AsyncThrottlerOptions.md | Updated: 11/15/2025

Source: https://tanstack.com/pacer/latest/docs/reference/interfaces/AsyncThrottlerOptions



TanStack

Pacer v0v0

Search...

+ K

Auto

Log In

TanStack StartRC

Docs Examples GitHub Contributors

TanStack Router

Docs Examples GitHub Contributors

TanStack Query

Docs Examples GitHub Contributors

TanStack Table

Docs Examples Github Contributors

TanStack Formnew

Docs Examples Github Contributors

TanStack DBbeta

Docs Github Contributors

TanStack Virtual

Docs Examples Github Contributors

TanStack Paceralpha

Docs Examples Github Contributors

TanStack Storealpha

Docs Examples Github Contributors

TanStack Devtoolsalpha

Docs Github Contributors

More Libraries

Maintainers Partners Support Learn StatsBETA Discord Merch Blog GitHub Ethos Brand Guide

Documentation

Framework

React logo

React

Version

Latest

Search...

+ K

Menu

Getting Started

Guides

API Reference

Debouncer API Reference

Throttler API Reference

Rate Limiter API Reference

Queue API Reference

Batcher API Reference

Debouncer Examples

Throttler Examples

Rate Limiter Examples

Queue Examples

Batcher Examples

TanStack Query Examples

Framework

React logo

React

Version

Latest

Menu

Getting Started

Guides

API Reference

Debouncer API Reference

Throttler API Reference

Rate Limiter API Reference

Queue API Reference

Batcher API Reference

Debouncer Examples

Throttler Examples

Rate Limiter Examples

Queue Examples

Batcher Examples

TanStack Query Examples

On this page

AsyncThrottlerOptions

Copy Markdown

Interface: AsyncThrottlerOptions<TFn>
=====================================

Defined in: async-throttler.ts:76

Options for configuring an async throttled function

Type Parameters
---------------
### TFn

TFn extends AnyAsyncFunction

Properties
----------
### asyncRetryerOptions?

ts

optional asyncRetryerOptions: AsyncRetryerOptions<TFn>;


optional asyncRetryerOptions: AsyncRetryerOptions<TFn>;

Defined in: async-throttler.ts:80

Options for configuring the underlying async retryer


### enabled?

ts

optional enabled: boolean | (throttler) => boolean;


optional enabled: boolean | (throttler) => boolean;

Defined in: async-throttler.ts:86

Whether the throttler is enabled. When disabled, maybeExecute will not trigger any executions. Can be a boolean or a function that returns a boolean. Defaults to true.


### initialState?

ts

optional initialState: Partial<AsyncThrottlerState<TFn>>;


optional initialState: Partial<AsyncThrottlerState<TFn>>;

Defined in: async-throttler.ts:90

Initial state for the async throttler


### key?

ts

optional key: string;


optional key: string;

Defined in: async-throttler.ts:95

Optional key to identify this async throttler instance. If provided, the async throttler will be identified by this key in the devtools and PacerProvider if applicable.


### leading?

ts

optional leading: boolean;


optional leading: boolean;

Defined in: async-throttler.ts:100

Whether to execute the function immediately when called Defaults to true


### onError()?

ts

optional onError: (error, args, asyncThrottler) => void;


optional onError: (error, args, asyncThrottler) => void;

Defined in: async-throttler.ts:106

Optional error handler for when the throttled function throws. If provided, the handler will be called with the error and throttler instance. This can be used alongside throwOnError - the handler will be called before any error is thrown.

#### Parameters ##### error

Error

##### args

Parameters<TFn>

##### asyncThrottler

AsyncThrottler <TFn>

#### Returns

void


### onSettled()?

ts

optional onSettled: (args, asyncThrottler) => void;


optional onSettled: (args, asyncThrottler) => void;

Defined in: async-throttler.ts:114

Optional function to call when the throttled function is executed

#### Parameters ##### args

Parameters<TFn>

##### asyncThrottler

AsyncThrottler <TFn>

#### Returns

void


### onSuccess()?

ts

optional onSuccess: (result, args, asyncThrottler) => void;


optional onSuccess: (result, args, asyncThrottler) => void;

Defined in: async-throttler.ts:121

Optional function to call when the throttled function is executed

#### Parameters ##### result

ReturnType<TFn>

##### args

Parameters<TFn>

##### asyncThrottler

AsyncThrottler <TFn>

#### Returns

void


### throwOnError?

ts

optional throwOnError: boolean;


optional throwOnError: boolean;

Defined in: async-throttler.ts:131

Whether to throw errors when they occur. Defaults to true if no onError handler is provided, false if an onError handler is provided. Can be explicitly set to override these defaults.


### trailing?

ts

optional trailing: boolean;


optional trailing: boolean;

Defined in: async-throttler.ts:136

Whether to execute the function on the trailing edge of the wait period Defaults to true


### wait

ts

wait: number | (throttler) => number;


wait: number | (throttler) => number;

Defined in: async-throttler.ts:142

Time window in milliseconds during which the function can only be executed once. Can be a number or a function that returns a number. Defaults to 0ms

Edit on GitHub

ThrottlerState

AsyncThrottlerState

Partners Become a Partner

Code RabbitCode Rabbit CloudflareCloudflare AG GridAG Grid NetlifyNetlify NeonNeon WorkOSWorkOS ClerkClerk ConvexConvex ElectricElectric SentrySentry PrismaPrisma StrapiStrapi UnkeyUnkey

scarf analytics