EventRefDisposable
A DisposableEx that unregisters an Obsidian EventRef on dispose, via the event source exposed on the ref itself (eventRef.e).
Import:
import { EventRefDisposable } from 'obsidian-dev-utils/obsidian/events';Signature:
export class EventRefDisposable extends DisposableBaseExtends: DisposableBase
Constructor
new EventRefDisposable(eventRef: EventRef)Creates a disposable wrapping an existing EventRef.
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 | Unregisters the event via the source stored on the ref (eventRef.e.offref). |