commit method

void commit()

Commit all updates atomically.

Implementation

void commit() {
  if (_committed) {
    throw StateError('Transaction already committed');
  }
  _committed = true;

  for (final entry in _updates.entries) {
    final signal = entry.key;
    final value = entry.value;
    signal.emit(value);
  }

  _updates.clear();
}