Nova · Actions
Reset
reset gives a path back the value it had when the action was opened.
{
id: 'reset',
data: { greeting: 'Dear Ada' },
layout: {
component: 'Stack',
children: [
{ component: 'Text', children: '$.greeting' },
{
component: 'Button',
ref: 'change',
children: 'Say hello',
},
{
component: 'Button',
ref: 'back',
children: 'As it was',
},
],
},
triggers: [
{
event: 'ui:click',
ref: 'change',
do: [{ set: 'greeting', value: 'Hello, Ada' }],
},
{
event: 'ui:click',
ref: 'back',
do: [{ reset: 'greeting' }],
},
],
}Dear Ada
press change press back
{ greeting: 'Dear Ada' }Dear Ada Say hello As it was
Left: the action as the package ships it. Right: the same action running in this page, rendered with this site’s components. Below: the action run as the example specifies, on the installed package.