Skip to content

toAsyncDisposableEx

Adapts a plain AsyncDisposable into an AsyncDisposableEx by adding a convenience AsyncDisposableEx.asyncDispose method that delegates to Symbol.asyncDispose.

If the object already implements AsyncDisposableEx, it is returned unchanged.

Import:

import { toAsyncDisposableEx } from 'obsidian-dev-utils/disposable';

Signature:

function toAsyncDisposableEx(asyncDisposable: AsyncDisposable): AsyncDisposableEx

Parameters:

ParameterTypeDescription
asyncDisposableAsyncDisposablethe async disposable to adapt

Returns: AsyncDisposableEx — An AsyncDisposableEx wrapping the async disposable.