emit3<A, B, C> method

void emit3<A, B, C>(
  1. String topic,
  2. A arg1,
  3. B arg2,
  4. C arg3,
)

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

Implementation

void emit3<A, B, C>(String topic, A arg1, B arg2, C arg3) {
  void _send(Function? fn) => fn!.call(arg1, arg2, arg3);
  _cache[topic]?.forEach(_send);
  _cacheOnce[topic]?.forEach(_send);
  _cacheOnce.remove(topic);
}