new Variable(variable, props)
This class represents a RAPID variable.
Parameters:
Properties| Name | Type | Description |
|---|---|---|
variable | RWS. | |
props | VariableProps | See VariableProps |
| Name | Type | Description |
|---|---|---|
var | object | Object returned by RWS.Rapid.getData(). |
- Source
- See
Methods
onChanged(callback)
Add a callback function to be executed when the variable value changes
Parameters:
| Name | Type | Description |
|---|---|---|
callback | * | The callback function that is called when the variable value changes. |
- Source
(async) subscribe(raiseInitial) → {undefined|Promise.<{}>}
Subscribes to a RAPID variable
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
raiseInitial | boolean | false | Raises an event after subscription |
- Source
Returns:
Undefined at success, reject Promise at failure.
- Type:
- undefined |
Promise.<{}>
(async) unsubscribe() → {undefined|Promise.<{}>}
Unsubscribes a RAPID variable
- Source
Returns:
Undefined at success, reject Promise at failure.
- Type:
- undefined |
Promise.<{}>