@tempots/dom

Signal.on property

Registers a listener function to be called whenever the value of the signal changes. The listener function will be immediately called with the current value of the signal. Returns a function that can be called to unregister the listener.

Signature:

readonly on: (listener: (value: T) => void) => () => void;