CallbackDisposable
A disposable that executes a callback when disposed.
Import:
import { CallbackDisposable } from 'obsidian-dev-utils/disposable';Signature:
export class CallbackDisposable extends DisposableBaseExtends: DisposableBase
Constructor
new CallbackDisposable(params: CallbackDisposableConstructorParams)Creates a new instance of CallbackDisposable.
Properties
| Property | Type | Description |
|---|---|---|
| multipleDisposeBehavior | MultipleDisposeBehavior | How the disposable behaves when disposed more than once. (Inherited from DisposableBase) |
Methods
| Method | Returns | Description |
|---|---|---|
| [Symbol.dispose]() | void | Disposes the object by running DisposableBase.performDispose, honoring the configured MultipleDisposeBehavior on a repeat dispose. (Inherited from DisposableBase) |
| dispose() | void | Disposes the object. Convenience alias that delegates to this[Symbol.dispose]().(Inherited from DisposableBase) |
| performDispose() | void | Runs the dispose callback. |
Links to this page: