VS Code API
    Preparing search index...

    Class Disposable

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

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    Constructors

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

      Note that an asynchronous function is not awaited.

      Parameters

      • callOnDispose: () => any

        Function that disposes something.

      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

      • ...disposableLikes: { dispose: () => any }[]

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

        • dispose: () => any

          Function to clean up resources.

      Returns Disposable

      Returns a new disposable which, upon dispose, will dispose all provided disposables.