Closed rglover closed 1 year ago
Added to canary. API required passing the component instance in (get() and set() are standalone functions and don't have direct access). Clean enough and works well:
set('connect_vultr', {
input: {
api_key: event?.target?.api_key?.value,
},
loader: {
instance,
state: 'connecting_vultr',
},
})
I routinely want to track whether or not I'm running a get() or set() in the UI on state so I can handle things like disabling buttons. Purely for convenience, it'd be helpful to have a
state
option that can be set to the name of a key that resolve totrue
orfalse
when aget()
orset()
is run. This would automatically set state behind the scenes for you w/o the need for extra code.