removeAllByCallback method

void removeAllByCallback (EventCallback callback)

Remove all listeners which matches with the callback provided. It is possible to register for multiple events with a single callback. This mechanism makesure that all event registrations would be cancelled which matches the callback.

Implementation

void removeAllByCallback(EventCallback callback) {
  if (null == callback) {
    throw ArgumentError.notNull("callback");
  }
  this._listeners.forEach((key, lst) {
    lst.removeWhere((item) => item?.callback == callback);
  });
}