State Variable
Last updated
Last updated
Any View can contain as many state variables as required, and its value can be set up as a constant or bound dynamically. State variables are not accessible between other Views; this means that every View can contain the same-named variables serving a different purpose.
Each of the variables has a unique ID, value, and type. Selecting the desired variable allows one to set up attributes in the Inspector panel. There is also an option to delete the current variable.
Value types of state variables are dependent on their usage. The most common String value is set up as a default, but options for Number, Boolean, Password, Map, and Array are also set up. Value-type can be changed by clicking on the proper icon.
ƒx: "Hello World"
ƒx: {first: "value1", second: "value2"}
ƒx: ["value1", "value2"]
All existing state variables and their values are visible in Data explorer. Any changes in names or values are immediately reflected.
Referencing variable values have to always correspond with Data explorer annotations.
Even updating a state of the variable by calling the proper function has to hold the correct syntax.
State variables can refer to each other.