A list of objects that can be closed or disposed.

Hierarchy

  • Array<Closer | Disposable | AsyncDisposable>
    • Closers

Implements

  • Disposable

Constructors

  • Parameters

    • arrayLength: number

    Returns Closers

  • Parameters

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

    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.