Skip to main content

batch

function

Combine multiple value updates into one "commit" at the end of the provided callback. Batches can be nested and changes are only flushed once the outermost batch callback completes. Accessing a signal that has been modified within a batch will reflect its updated value.

function batch<T>(fn: () => T): T

Import

import { batch } from '@modular/sdk/editor';

Notes

returns
The value returned by the callback.