TanStack
Batcher API Reference

AlpineAsyncBatcher

Defined in: async-batcher/createAsyncBatcher.ts:21

An AsyncBatcher with framework-reactive selected state. All core methods remain available.

Extends

  • Omit<AsyncBatcher<TValue>, "options" | "setOptions">

Type Parameters

TValue

TValue

TSelected

TSelected = { }

Properties

options

ts
options: Omit<Required<AsyncBatcherOptions<TValue>>,
  | "initialState"
  | "key"
  | "onError"
  | "onSettled"
  | "onSuccess"
  | "onItemsChange"> & Partial<Pick<Required<AsyncBatcherOptions<TValue>>,
  | "initialState"
  | "key"
  | "onError"
  | "onSettled"
  | "onSuccess"
| "onItemsChange">> & AlpineAsyncBatcherOptions<TValue, TSelected>;

Defined in: async-batcher/createAsyncBatcher.ts:25


setOptions

ts
setOptions: (options) => void;

Defined in: async-batcher/createAsyncBatcher.ts:27

Parameters

options

Partial<AlpineAsyncBatcherOptions<TValue, TSelected>>

Returns

void


state

ts
readonly state: Readonly<TSelected>;

Defined in: async-batcher/createAsyncBatcher.ts:33

Selected state. Pass a selector to opt in; the default selection is an empty object.


subscribe

ts
subscribe: AlpinePacerSubscribe<AsyncBatcherState<TValue>>;

Defined in: async-batcher/createAsyncBatcher.ts:31

Subscribes a child owner to selected state with automatic cleanup.