on<T extends NyEvent> method

void on<T extends NyEvent>(
  1. NyListener listener
)

Implementation

void on<T extends NyEvent>(NyListener listener) {
  _subscriptions[T] ??= [];
  if (!_subscriptions[T]!.contains(listener)) {
    _subscriptions[T]!.add(listener);
  }
}