A list of objects that can be closed or disposed.

Hierarchy

  • Array<Closer | Disposable | AsyncDisposable>
    • Closers

Implements

  • Disposable

Indexable

  • [n: number]: Disposable | AsyncDisposable | Closer

Constructors

  • Parameters

    • arrayLength: number

    Returns Closers

  • Parameters

    • ...items: (Disposable | AsyncDisposable | Closer)[]

    Returns Closers

Methods

  • Schedule a timeout or interval to be canceled upon close.

    Type Parameters

    • T extends number | Timeout

    Parameters

    Returns T

  • Close all objects and clear the list.

    Returns void

    All objects added to this array are closed, in the reversed order as they appear in the array. This is a synchronous function, so that any AsyncDisposable objects in the array would have its asyncDispose method is called but not awaited. This array is cleared and can be reused.