Skip to main content

on

Description​

Registers to the event with the given handler

on(value: () => void): () => void
ParameterSummary
valueAll

The function to call when the event occurs.

Returns​

A function which can be called to unregister the registered handler. This is usedful if the original function passed to this is not stored somewhere but unregistering of the event needs to be done.