batch<T> function

T batch<T>(
  1. T cb()
)

Batches multiple signal updates into a single synchronous notification cycle.

Prevents intermediate states from triggering redundant recomputations or UI rebuilds.

Example:

batch(() {
  firstName.value = 'Grace';
  lastName.value = 'Hopper';
});

Implementation

T batch<T>(T Function() cb) {
  return sf.batch<T>(cb);
}