set-state
The set-state action sets the global state (also called the solution state). Multiple components and jigs can access the state's value across the solution. Effectively managing the global state ensures that all parts of the app that depend on this data are updated consistently. To understand how to use states, see State.
Configuration options
A set-state action can be set up in various ways:
As
onFocusaction that will be executed.As
onRefreshaction that will be executed.As the main action on the jig, and when you press the action, the
set-stateaction will be executed.The
onPressandonChangeactions will be executed when you trigger these events.
Examples and code snippets
set-state as onFocus/onRefresh
Set state action is used when the onFocus/onRefresh event is triggered and a count is shown of the number of triggers.
See the example in GitHub.
onFocus:
type: action.set-state
options:
state: [email protected]
value: [email protected] +1 onRefresh:
type: action.set-state
options:
state: [email protected]
value: [email protected] +1set-state as action
Set-state action is used as the primary action on the jig, to set the value of the action-key to +1.
See the example in GitHub.
actions:
- children:
- type: action.set-state
options:
title: Add 1 to your action-key
state: [email protected]
value: [email protected] +1set-state as onPress/onChange
Set-state action used on the list as onPress/onChange action, to set the value of the key to +1.
See the example in GitHub.
onPress:
type: action.set-state
options:
state: [email protected]
value: [email protected] +1onChange:
type: action.set-state
options:
state: [email protected]
value: [email protected] +1
::
::::Last updated
Was this helpful?