States
Enable reactivity with Umbraco States, allowing you to provide a value that others can observe and update when the value changes.
const myState = UmbStringState('the initial value');
const myObservable = myState.asObservable();
this.observe(myObservable, (value) => {
console.log(value);
});
myState.setValue('updated value');> 'the initial value'
> 'updated value'State Types
Observation
Observe
Change the value of a State
Observe part of a State value
Summary example
Last updated
Was this helpful?