publish1<T> method

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

Publishes the specified event topic along with the given arg1 (argument) to all registered callbacks for that event.

Implementation

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