定义于:batcher.ts:52
用于配置 Batcher 实例的选项
• TValue
optional getShouldExecute: (items, batcher) => boolean;
optional getShouldExecute: (items, batcher) => boolean;
定义于:batcher.ts:57
用于确定是否应处理批次的自定义函数。返回 true 以立即处理批次。
TValue[]
Batcher<TValue>
boolean
optional initialState: Partial<BatcherState<TValue>>;
optional initialState: Partial<BatcherState<TValue>>;
定义于:batcher.ts:61
批处理器的初始状态
optional key: string;
optional key: string;
定义于:batcher.ts:66
用于标识此批处理器实例的可选键。如果提供,批处理器将在开发者工具和 PacerProvider(如果适用)中以此键进行标识。
optional maxSize: number;
optional maxSize: number;
定义于:batcher.ts:71
批次中的最大项目数
Infinity
Infinity
optional onExecute: (batch, batcher) => void;
optional onExecute: (batch, batcher) => void;
定义于:batcher.ts:75
批次处理后触发的回调
TValue[]
Batcher<TValue>
void
optional onItemsChange: (batcher) => void;
optional onItemsChange: (batcher) => void;
定义于:batcher.ts:79
向批处理器添加项目后触发的回调
Batcher<TValue>
void
optional started: boolean;
optional started: boolean;
定义于:batcher.ts:84
批处理器是否应立即开始处理
true
true
optional wait: number | (batcher) => number;
optional wait: number | (batcher) => number;
定义于:batcher.ts:91
在处理批次之前等待的最大毫秒数。如果等待时间已过,则将处理批次。如果未提供,则批次不会由超时触发。
Infinity
Infinity
您的每周 JavaScript 资讯。每周一免费发送给超过 10 万开发者。