Interface: IWatchedValueReadonly<T>
Broker.IWatchedValueReadonly
Type parameters
Name |
---|
T |
Hierarchy
-
↳
IWatchedValueReadonly
Methods
subscribe
▸ subscribe(callback
, options?
): void
Subscribe to watched value changes
Parameters
Name | Type | Description |
---|---|---|
callback | (value : T ) => void | callback to be evoked when change occurs |
options? | WatchedValueSubscribeOptions | watch subscriber options |
Returns
void
Overrides
IObservableValueReadOnly.subscribe
unsubscribe
▸ unsubscribe(callback?
): void
Unsubscribe to watched value changes
Parameters
Name | Type | Description |
---|---|---|
callback? | (value : T ) => void | callback to remove |
Returns
void
Overrides
IObservableValueReadOnly.unsubscribe
value
▸ value(): T
Value
Returns
T
Inherited from
IObservableValueReadOnly.value
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