AsyncDisposableBase
Abstract base for an AsyncDisposableEx: it carries the re-dispose guard (via MultipleDisposeBehavior) and the AsyncDisposableEx.asyncDispose alias; a subclass only implements AsyncDisposableBase.performDisposeAsync.
Import:
import { AsyncDisposableBase } from 'obsidian-dev-utils/disposable';Signature:
export class AsyncDisposableBase implements AsyncDisposableExImplements: AsyncDisposableEx
Properties
| Property | Type | Description |
|---|---|---|
| multipleDisposeBehavior | MultipleDisposeBehavior | How the disposable behaves when disposed more than once. |
Methods
| Method | Returns | Description |
|---|---|---|
| [Symbol.asyncDispose]() | Promise<void> | Disposes the object by running AsyncDisposableBase.performDisposeAsync, honoring the configured MultipleDisposeBehavior on a repeat dispose. |
| asyncDispose() | Promise<void> | Disposes the object. Convenience alias that delegates to this[Symbol.asyncDispose](). |
| performDisposeAsync() | Promisable<void> | Performs the actual teardown. Called at most once unless MultipleDisposeBehavior.Invoke is set. |
Links to this page: