Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Disposable

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

Hierarchy

Index

Methods(2)

Constructors(1)

Methods(2)

Static from

  • from(...disposableLikes: { dispose: any }[]): Disposable
  • 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 ...disposableLikes: { dispose: any }[]

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

    Returns Disposable

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

dispose

  • dispose(): any

Constructors(1)

constructor

  • new Disposable(callOnDispose: () => any): Disposable
  • 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.

        • (): any
        • Returns any

    Returns Disposable

Generated by TypeDoc. Maintained by 洛竹