startBatchUpdate method

void startBatchUpdate()

Starts a batch update session for this computed instance.

During a batch update, changes to the value are buffered and not immediately sent to listeners. This can be useful when you need to make multiple rapid changes to source values and want to minimize the number of notifications.

Batch updates can be nested. The buffered updates will only be published when the outermost batch update is ended with endBatchUpdate.

Example usage:

// Start batching updates
computed.startBatchUpdate();

// Make multiple changes to sources
source1.value = 10;
source2.value = 20;
source3.value = 30;

// End batching and publish the final update
computed.endBatchUpdate();

See also:

Implementation

void startBatchUpdate() {
  _batchUpdateCounter++;
}