addSubscription method

void addSubscription(
  1. StreamSubscription subscription
)
inherited

Register a subscription that should be canceled when the component unmounts.

Cancellation will be handled automatically by componentWillUnmount.

Implementation

void addSubscription(StreamSubscription subscription) {
  _subscriptions.add(subscription);
}