remove method

void remove(
  1. String eventName, [
  2. EventCallback? eventCallback
])

移除订阅者

Implementation

void remove(String eventName, [EventCallback? eventCallback]) {
  final List<EventCallback>? list = _map[eventName];
  if (list == null) return;
  if (eventCallback == null) {
    _map.remove(eventName);
  } else {
    list.remove(eventCallback);
  }
}