useVariable
Usage
Use the hook with no input parameters (returns a list of variables)
You can also pass qId
or qName
as parameters. This will return data and actions for a specific variable.
Pass qName
and qDefinition
to create a session variable
Variable Options
The following options can be passed into the hook
name: String
The name of the variable to use. Combine with
qDefinition
, or pass on it's own to retrieve information from the engine
definition: String
Variable expression
Variable Properties
The following properties are returned from the hook
qLayout: Object
Layout of the variable
Returns an object with the following keys if no variable is passed into the hook
qInfo: {qId: "...", qType: "...."}
qMeta: {privileges: Array(3)}
qSelectionInfo: Object
qVariableList: {qItems: <Array>}
variableList: <Array[Obj]>
Returns an object with the following keys if a variable is passed into the hook
qInfo: {qId: "...", qType: "...."}
qMeta: {privileges: Array(3)}
qText: String
qNum: Number
value: String
qProperties
: Returns data in this structuresetProperties
: Returns data in this structure
The above properties in qLayout are also available de-structured from the hook, see the usage examples above
Example
A working example using Motor to update a slider can be found here.
Last updated