Skip to content

AsyncCallbackDisposable

An async disposable that executes a callback when disposed via await using (or a manual await disposable[Symbol.asyncDispose]()).

Import:

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

Signature:

export class AsyncCallbackDisposable extends AsyncDisposableBase

Extends: AsyncDisposableBase

Constructor

new AsyncCallbackDisposable(params: AsyncCallbackDisposableConstructorParams)

Creates a new instance of AsyncCallbackDisposable.

Properties

PropertyTypeDescription
multipleDisposeBehaviorMultipleDisposeBehaviorHow the disposable behaves when disposed more than once.
(Inherited from AsyncDisposableBase)

Methods

MethodReturnsDescription
[Symbol.asyncDispose]()Promise<void>Disposes the object by running AsyncDisposableBase.performDisposeAsync, honoring the configured MultipleDisposeBehavior on a repeat dispose.
(Inherited from AsyncDisposableBase)
asyncDispose()Promise<void>Disposes the object. Convenience alias that delegates to this[Symbol.asyncDispose]().
(Inherited from AsyncDisposableBase)
performDisposeAsync()Promise<void>Runs the dispose callback.

Links to this page: