Skip to content

Observable class fields support

Compare
Choose a tag to compare
@cherifGsoul cherifGsoul released this 12 Jun 19:23
· 4 commits to master since this release
  • 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

#104