add<T> method

StreamSubscription<T> add<T>(
  1. StreamSubscription<T> subscription
)

Adds new subscription to this composite.

Throws an exception if this composite was disposed

Implementation

StreamSubscription<T> add<T>(StreamSubscription<T> subscription) {
  if (isDisposed) {
    throw StateError(
        'This $runtimeType was disposed, consider checking `isDisposed` or try to use new instance instead');
  }
  _subscriptionsList.add(subscription);
  return subscription;
}