Skip to main content

Function: batch()

batch<T>(fn): ReturnType<T>

Defined in: packages/ffi/src/batch.ts:110

Executes a function with automatic batching.

Wraps the function in beginBatch/endBatch calls.

Type Parameters

Type Parameter
T extends (...args) => unknown

Parameters

ParameterTypeDescription
fnTFunction to execute with batching

Returns

ReturnType<T>

The function's return value

Example

batch(() => {
widget.setVisible(true);
widget.setSensitive(true);
widget.setCssClasses(["active"]);
});