Skip to content

Welshman Docs / @welshman/lib / batch

Function: batch() ​

batch<T>(t, f): (x) => void

Defined in: packages/lib/src/Tools.ts:1001

Creates batching function that collects items this function does not delay execution, if a series of items is passed in sequence the first item will be processed immediately, and the rest will be batched

Type Parameters ​

• T

Parameters ​

t ​

number

Time window for batching

f ​

(xs) => void

Function to process batch

Returns ​

Function

Function that adds items to batch

Parameters ​

x ​

T

Returns ​

void