removeAllHandlerPresentInOtherBus method

  1. @override
void removeAllHandlerPresentInOtherBus(
  1. EventBus otherBus
)
override

Removes all handlers that are present in another EventBus from this one.

Implementation

@override
void removeAllHandlerPresentInOtherBus(EventBus otherBus) {
  _checkNotDisposed();
  if (otherBus is EventBusMixin) {
    for (var element in otherBus._eventsMap.entries) {
      var node = _eventsMap.remove(element.key);
      if (node != null && !identical(node, element.value)) {
        unawaited(node.dispose());
      }
    }
  }
}