A list of objects that can be closed or disposed.


  • Array<Closer | Disposable | AsyncDisposable>
    • Closers


  • Disposable


  • Parameters

    • arrayLength: number

    Returns Closers

  • Parameters

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

    Returns Closers


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

    Type Parameters

    • T extends number | Timeout


    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.