Skip to content

PluginSettingsComponentBase.on method

PluginSettingsComponentBase › on

Add an event listener.

Signature:

on(name: EventName, callback: (...args: Args) => Promisable<void>, thisArg?: unknown): AsyncEventRef

Parameters:

ParameterTypeDescription
nameEventNameThe name of the event.
callback(...args: Args) => Promisable<void>The callback to call when the event is triggered.
thisArg?unknownThe context passed as this to the callback.

Returns: AsyncEventRefA reference to the event listener.

Remarks:

Not refactored to parameter-object pattern, to keep the parity with obsidian#Events#on (or once, correspondingly).