Supervised-EmitterISubscription

Interface: ISubscription

.subscribe() method's interface. Since this interface return ISubscription on subscribe|subscribeOnce, you may chain as many subscriptions as needed and all the chained subscription can be unsubscribed by running unsubscription just once on the final subscription returned.

Example

const subscription = SE.subscribe('foo/bar', () => {})
                       .subscribe('hello/world', () => {});

subscription.unsubscribe();

Hierarchy

  • ISubscription

Index

Methods

Methods

subscribe

subscribe(event: string, ...handlers: IHandler[]): ISubscription

Parameters:

Name Type
event string
...handlers IHandler[]

Returns: ISubscription


unsubscribe

unsubscribe(): void

Returns: void

results matching ""

    No results matching ""