batch<T> static method

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

Execute multiple reactive writes as a single atomic update.

Underlying .value reads reflect new values immediately inside fn, while ZenObserver rebuilds, ZenWorker callbacks, and listened RxComputed evaluations are deferred and flushed once when the outermost batch completes.

Rx.batch(() {
  firstName.value = 'Ada';
  lastName.value = 'Lovelace';
});

Implementation

static T batch<T>(T Function() fn) => RxBatch.run<T>(fn);