Interface: IWatchedValue<T>
Broker.IWatchedValue
Type parameters
| Name | 
|---|
T | 
Hierarchy
- 
↳
IWatchedValue 
Methods
setValue
▸ setValue(value, forceUpdate?): void
Set value for the watched value
Parameters
| Name | Type | Description | 
|---|---|---|
value | T | value to set | 
forceUpdate? | boolean | force an update | 
Returns
void
Overrides
subscribe
▸ subscribe(callback, options?): void
Subscribe to watched value changes
Parameters
| Name | Type | Description | 
|---|---|---|
callback | WatchedValueCallback<T> | callback to be evoked when change occurs | 
options? | WatchedValueSubscribeOptions | watch subscriber options | 
Returns
void
Overrides
unsubscribe
▸ unsubscribe(callback?): void
Unsubscribe to watched value changes
Parameters
| Name | Type | Description | 
|---|---|---|
callback? | WatchedValueCallback<T> | callback to remove | 
Returns
void
Overrides
value
▸ value(): T
Value
Returns
T
Inherited from
when
▸ when(callback): void
A simplified version of subscription, with promise-like interface, generally for using with boolean-valued watched values
Parameters
| Name | Type | Description | 
|---|---|---|
callback | WatchedValueCallback<T> | a function to be called when the value became true. once and callWithLast are implicitly set to true. | 
Returns
void