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