delete method

  1. @override
bool delete(
  1. Object disposable
)
override

Removes (but does not dispose) the given disposable if it is part of this container.

disposable must be a StreamSubscription or a Sink.

Returns true if disposable was in this bag, and false if not. The method has no effect if disposable was not in this bag.

Throws DisposedException or ClearingException if this bag has been disposed or is disposing.

Implementation

@override
bool delete(Object disposable) {
  _guardType(disposable);

  return _validResourcesOrThrows().remove(disposable);
}