cancel method

void cancel()

Cancels all existing StreamSubscriptions. If subscribe is invoked, then cancel should also be invoked when subscriptions are no longer needed.

Implementation

void cancel() {
  for (final s in _subscriptions) {
    s.cancel();
  }
  _subscriptions.clear();
}