emit method

dynamic emit({
  1. bool quiet = false,
})

Emits a change if the map has been modified since the last emit (or since it was initialized).

To emit a change but prevent a parent EmitterContainer from emitting a change, set quiet to true.

Implementation

emit({bool quiet = false}) {
  assert(!isDisposed);
  if (_dirty && !quiet)
    addChangeToStream(
        emitDetailedChanges ? MapChange(_changes) : MapChange.any());
  else if (_dirty)
    addChangeToStream(emitDetailedChanges
        ? MapChange(_changes, quiet: true)
        : MapChange.any(quiet: true));
  _changes.clear();
  _dirty = false;
}