Defined in: batcher.ts:6
Options for configuring a Batcher instance
• TValue
optional getShouldExecute: (items, batcher) => boolean;
optional getShouldExecute: (items, batcher) => boolean;
Defined in: batcher.ts:11
Custom function to determine if a batch should be processed Return true to process the batch immediately
TValue[]
Batcher<TValue>
boolean
optional maxSize: number;
optional maxSize: number;
Defined in: batcher.ts:16
Maximum number of items in a batch
Infinity
Infinity
optional onExecute: (batcher) => void;
optional onExecute: (batcher) => void;
Defined in: batcher.ts:20
Callback fired after a batch is processed
Batcher<TValue>
void
optional onIsRunningChange: (batcher) => void;
optional onIsRunningChange: (batcher) => void;
Defined in: batcher.ts:24
Callback fired when the batcher's running state changes
Batcher<TValue>
void
optional onItemsChange: (batcher) => void;
optional onItemsChange: (batcher) => void;
Defined in: batcher.ts:28
Callback fired after items are added to the batcher
Batcher<TValue>
void
optional started: boolean;
optional started: boolean;
Defined in: batcher.ts:33
Whether the batcher should start processing immediately
true
true
optional wait: number;
optional wait: number;
Defined in: batcher.ts:40
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.
Infinity
Infinity
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.