subscribeEvent<Source, EventName>
Subscribes to an event on an Events source and returns the raw EventRef (parity with Events.on). Typed wrapper: the event name and callback arguments are autocompleted from the source’s overloads.
Import:
import { subscribeEvent } from 'obsidian-dev-utils/obsidian/events';Signature:
function subscribeEvent(params: SubscribeEventParams<Source, EventName>): EventRefParameters:
| Parameter | Type | Description |
|---|---|---|
params | SubscribeEventParams<Source, EventName> | The subscription parameters. |
Returns: EventRef — The EventRef for the registered handler.
Links to this page: