Represents a type which can release resources, such as event listening or a timer.

Implements

Constructors

Methods

Constructors

  • Creates a new disposable that calls the provided function on dispose.

    Note that an asynchronous function is not awaited.

    Parameters

    • onDispose: (() => void)

      Function that disposes something.

        • (): void
        • Returns void

    Returns Disposable

Methods

  • Combine many disposable-likes into one. You can use this method when having objects with a dispose function which aren't instances of Disposable.

    Parameters

    • Rest ...disposables: DisposableLike[]

      Objects that have at least a dispose-function member. Note that asynchronous dispose-functions aren't awaited.

    Returns Disposable

    • A new disposable which, upon dispose, will dispose all provided disposables.

Generated using TypeDoc