Optional
equalAn equality function used to check whether the value of the signal has been changed. Default is Object.is.
Optional
getLazily provides a value for an inactive writable signal when it is read.
Semantics:
set/emit
is called while the signal is inactive, that update is applied
immediately (including onUpdate
), but the next cold read will override
the stored value with getInitialValue()
until activation.Optional
nameA name of the signal. Can be accessed inside a lifecycle function via this.
Optional
onA function called when the first subscriber or the first active dependent signal appears.
Optional
onA function called each time before the signal value is calculated and when the signal is going to be deactivated. Useful to cleanup subscriptions and timers created during computation.
The current value of the signal.
Optional
onA function called at the moment the signal is created.
Optional
value: TAn initial value of the signal.
Optional
onA function called when the last subscriber or the last active dependent signal disappears.
The current value of the signal.
Optional
onA function called whenever an unhandled exception occurs during the calculation of the signal value.
An exception.
The previous value of the signal.
Optional
onA function called each time the signal value is updated.
An object that stores the options of the writable signal to be created.