cancelSingletonSubscription method

bool cancelSingletonSubscription(
  1. Object singletonIdentifier, [
  2. bool singletonIdentifyByInstance = true
])

Cancels StreamSubscription associated with singletonIdentifier.

Implementation

bool cancelSingletonSubscription(Object singletonIdentifier,
    [bool singletonIdentifyByInstance = true]) {
  var signature =
      _getListenSignature(singletonIdentifier, singletonIdentifyByInstance);

  if (signature != null) {
    _listenSignatures.remove(signature);
    return signature.cancel();
  }

  return false;
}