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) {
  assert(subscription != null, 'Subscription cannot be null');
  if (isDisposed) {
    throw ('This composite was disposed, try to use new instance instead');
  }
  _subscriptionsList.add(subscription);
  return subscription;
}