Rate this page:

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

Copy URL
clear(): 

void

Clears all observers for this watchable excluding the ones created with WatchOptions.clearable: false.

Returns

  • type:

    void

unwatch

Copy URL
unwatch(onValueChangeCallback: 

OnValueChangeCallback

):

void

Stops triggering the specified callback on the value change.

Parameters

Returns

  • type:

    void

watch

Copy URL
watch(onValueChangeCallback: 

OnValueChangeCallback

,
options:

WatchOptions

):

UnwatchFunction

Subscribes to the value changes.

When the value is changed, the OnValueChangeCallback callback is triggered.

Returns UnwatchFunction, to unwatch observable value changes.

Parameters

Returns

Props

oldValue

Copy URL
oldValue: 

T

Previous value of the observable property.

value

Copy URL
value: 

T

Current value of the observable property.