ReadonlyWatchable
Basic WebSDK reactive type for immutable structures and primitives, the same as Watchable, but with readonly values. Setting a new value is ignored without any error, with only a warn message in the console.
Methods
clear
clear(): void
Clears all observers for this watchable excluding the ones created with WatchOptions.clearable: false.
Returns
type:
void
unwatch
unwatch(onValueChangeCallback: ): void
Stops triggering the specified callback on the value change.
Parameters
onValueChangeCallback:
Observer that should not be triggered anymore
Returns
type:
void
watch
watch(onValueChangeCallback: , options: ):
Subscribes to the value changes.
When the value is changed, the OnValueChangeCallback callback is triggered.
Returns UnwatchFunction, to unwatch observable value changes.
Parameters
onValueChangeCallback:
Observer to be triggered when the value is changed
options:
OptionalOptions
Returns
type:
Props
oldValue
oldValue: T
Previous value of the observable property.
value
value: T
Current value of the observable property.