unsubscribe method

bool unsubscribe(
  1. String topic,
  2. Function callback
)

Unregisters the specified callback from the specified event topic.

Returns true if the callback was found and removed, false otherwise.

Implementation

bool unsubscribe(String topic, Function callback) {
  final subs = _cache[topic]!;
  return subs.remove(callback);
}