batch function

void batch(
  1. void fn()
)

Batches multiple signal updates together so that dependent effects only run once after the batch function completes.

Implementation

void batch(void Function() fn) {
  startBatch();
  try {
    fn();
  } finally {
    endBatch();
  }
}