Skip to content

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 DisposableBase

Extends: DisposableBase

Constructor

new EventRefDisposable(eventRef: EventRef)

Creates a disposable wrapping an existing EventRef.

Properties

PropertyTypeDescription
multipleDisposeBehaviorMultipleDisposeBehaviorHow the disposable behaves when disposed more than once.
(Inherited from DisposableBase)

Methods

MethodReturnsDescription
[Symbol.dispose]()voidDisposes the object by running DisposableBase.performDispose, honoring the configured MultipleDisposeBehavior on a repeat dispose.
(Inherited from DisposableBase)
dispose()voidDisposes the object. Convenience alias that delegates to this[Symbol.dispose]().
(Inherited from DisposableBase)
performDispose()voidUnregisters the event via the source stored on the ref (eventRef.e.offref).