atvik
    Preparing search index...

    Interface AsyncSubscriptionHandle

    Handle that points to a previously subscribed listener. This handle is returned when a subscription occurs and can be used to remove the subscription.

    The handle is AsyncDisposable, so await using can unsubscribe the listener at the end of a block:

    {
    await using handle = await event.subscribe(listener);
    // listener receives events here
    }
    // listener is unsubscribed here
    interface AsyncSubscriptionHandle {
        "[asyncDispose]"(): PromiseLike<void>;
        unsubscribe(): Promise<void>;
    }

    Hierarchy

    • AsyncDisposable
      • AsyncSubscriptionHandle
    Index
    • Returns PromiseLike<void>

    • Unsubscribe, the listener will no longer receive events.

      Returns Promise<void>

      promise that resolves when the listener is fully unsubscribed