publishParams method

void publishParams(
  1. String topic,
  2. CallbackParams args
)

Publishes the specified topic along with the given CallbackParams to all registered callbacks for that topic.

The CallbackParams provide positional and named arguments to pass to the callbacks.

Implementation

void publishParams(String topic, CallbackParams args) {
  void _send(Function? fn) =>
      Function.apply(fn!, args.positional, args.named);
  _cache[topic]?.forEach(_send);
  _cacheOnce[topic]?.forEach(_send);
  _cacheOnce.remove(topic);
}