shelving/util/disposemodule

Functions

Go

dispose()function

Safely dispose one or more synchronous Disposable values.

dispose(...values: Nullish<Disposable | Callback>[]): void
Go

awaitDispose()function

Safely dispose one or more AsyncDisposable or Disposable values in parallel — all are disposed even if some throw, errors are rethrown at the end.

awaitDispose(...values: Nullish<AsyncDisposable | Disposable | Callback | Promise<unknown>>[]): Promise<void>
Go

isDisposable()function

Is an unknown value a disposable object?

isDisposable(v: unknown): v is Disposable
Go

isAsyncDisposable()function

Is an unknown value an async disposable object?

isAsyncDisposable(v: unknown): v is AsyncDisposable

Classes

Go

DisposableMapclass

Version of Map that has disposable values.

new DisposableMap<K, T>()
Go

DisposableSetclass

Version of Set that has disposable items.

new DisposableSet<T>()