123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import { SubscriptionLike, TeardownLogic } from './types';
- export declare class Subscription implements SubscriptionLike {
-
- static EMPTY: Subscription;
-
- closed: boolean;
-
- protected _parentOrParents: Subscription | Subscription[];
-
- private _subscriptions;
-
- constructor(unsubscribe?: () => void);
- /**
- * Disposes the resources held by the subscription. May, for instance, cancel
- * an ongoing Observable execution or cancel any other type of work that
- * started when the Subscription was created.
- * @return {void}
- */
- unsubscribe(): void;
- /**
- * Adds a tear down to be called during the unsubscribe() of this
- * Subscription. Can also be used to add a child subscription.
- *
- * If the tear down being added is a subscription that is already
- * unsubscribed, is the same reference `add` is being called on, or is
- * `Subscription.EMPTY`, it will not be added.
- *
- * If this subscription is already in an `closed` state, the passed
- * tear down logic will be executed immediately.
- *
- * When a parent subscription is unsubscribed, any child subscriptions that were added to it are also unsubscribed.
- *
- * @param {TeardownLogic} teardown The additional logic to execute on
- * teardown.
- * @return {Subscription} Returns the Subscription used or created to be
- * added to the inner subscriptions list. This Subscription can be used with
- * `remove()` to remove the passed teardown logic from the inner subscriptions
- * list.
- */
- add(teardown: TeardownLogic): Subscription;
- /**
- * Removes a Subscription from the internal list of subscriptions that will
- * unsubscribe during the unsubscribe process of this Subscription.
- * @param {Subscription} subscription The subscription to remove.
- * @return {void}
- */
- remove(subscription: Subscription): void;
- }
|