emit2<T, S> method

void emit2<T, S>(
  1. String topic,
  2. T arg1,
  3. S arg2
)

Emits a signal to all subscribed functions for a topic in the event system. This method calls all functions subscribed to the topic with two arguments. Any errors thrown by the functions are silently ignored.

Implementation

void emit2<T, S>(String topic, T arg1, S arg2) {
  void _send(Function? fn) => fn!.call(arg1, arg2);
  _cache[topic]?.forEach(_send);
  _cacheOnce[topic]?.forEach(_send);
  _cacheOnce.remove(topic);
}