emit1<T> method

void emit1<T>(
  1. String topic,
  2. T arg1
)

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

Implementation

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