on method

TTEvent<T, U, V> on(
  1. EventCb<T, U, V> cb
)

Register a listener on this event

@param cb the callback to subscribe

Implementation

TTEvent<T, U, V> on(EventCb<T, U, V> cb) {
  _mutexAcquire(() {
    if (_listeners.contains(cb)) {
      return;
    }
    _listeners.add(cb);
  });
  return this;
}