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

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

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



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

BatcherOptions

Copy Markdown

Interface: BatcherOptions<TValue>
=================================

Defined in: batcher.ts:52

Options for configuring a Batcher instance

Type Parameters
---------------
### TValue

TValue

Properties
----------
### getShouldExecute()?

ts

optional getShouldExecute: (items, batcher) => boolean;


optional getShouldExecute: (items, batcher) => boolean;

Defined in: batcher.ts:57

Custom function to determine if a batch should be processed Return true to process the batch immediately

#### Parameters ##### items

TValue[]

##### batcher

Batcher <TValue>

#### Returns

boolean


### initialState?

ts

optional initialState: Partial<BatcherState<TValue>>;


optional initialState: Partial<BatcherState<TValue>>;

Defined in: batcher.ts:61

Initial state for the batcher


### key?

ts

optional key: string;


optional key: string;

Defined in: batcher.ts:66

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


### maxSize?

ts

optional maxSize: number;


optional maxSize: number;

Defined in: batcher.ts:71

Maximum number of items in a batch

#### Default

ts

Infinity


Infinity

### onExecute()?

ts

optional onExecute: (batch, batcher) => void;


optional onExecute: (batch, batcher) => void;

Defined in: batcher.ts:75

Callback fired after a batch is processed

#### Parameters ##### batch

TValue[]

##### batcher

Batcher <TValue>

#### Returns

void


### onItemsChange()?

ts

optional onItemsChange: (batcher) => void;


optional onItemsChange: (batcher) => void;

Defined in: batcher.ts:79

Callback fired after items are added to the batcher

#### Parameters ##### batcher

Batcher <TValue>

#### Returns

void


### started?

ts

optional started: boolean;


optional started: boolean;

Defined in: batcher.ts:84

Whether the batcher should start processing immediately

#### Default

ts

true


true

### wait?

ts

optional wait: number | (batcher) => number;


optional wait: number | (batcher) => number;

Defined in: batcher.ts:91

Maximum time in milliseconds to wait before processing a batch. If the wait duration has elapsed, the batch will be processed. If not provided, the batch will not be triggered by a timeout.

#### Default

ts

Infinity


Infinity

Edit on GitHub

useAsyncQueuedState

BatcherState

Partners Become a Partner

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

scarf analytics