Observable class fields support
- Add observable class fields support:
class MyElement extends StacheElement {
greetings = 'Hello';
static get view() { return `{{ greetings }}` }
static get props() {
}
}
customElements.define('my-element', MyElement);
const el = new MyElement().initialize();
el.on('greeting', (ev, newVal, oldVal) => {
// it should be observable, handle change here
});
el.greeting = 'Hola';
- Observable class fields support documentation