emit method
Emits a signal to all subscribed functions for a topic
in the event
system. This method calls all functions subscribed to the topic with no
arguments. Any errors thrown by the functions are silently ignored.
Implementation
MPS emit(String topic) {
void _send(Function? fn) => fn!.call();
_cache[topic]?.forEach(_send);
_cacheOnce[topic]?.forEach(_send);
_cacheOnce.remove(topic);
return this;
}