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 AsyncDisposableBaseExtends: AsyncDisposableBase
Constructor
new AsyncCallbackDisposable(params: AsyncCallbackDisposableConstructorParams)Creates a new instance of AsyncCallbackDisposable.
Properties
| Property | Type | Description |
|---|---|---|
| multipleDisposeBehavior | MultipleDisposeBehavior | How the disposable behaves when disposed more than once. (Inherited from AsyncDisposableBase) |
Methods
| Method | Returns | Description |
|---|---|---|
| [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: