publish method

void publish(
  1. String topic
)

Publishes the specified event topic to all registered callbacks for that event without any arguments.

Implementation

void publish(String topic) {
  void _send(Function? fn) => fn!.call();
  _cache[topic]?.forEach(_send);
  _cacheOnce[topic]?.forEach(_send);
  _cacheOnce.remove(topic);
}