This is my take on most of the issues... but I threw it up on my phone.
import {$ce} from 'z3util-dom'; class Adder extends HTMLElement { connectedCallback() { this.createShadowRoot({"mode": "closed"}).append( this.#a = $ce('input', {"type": "number"}), this.#b = $ce('input', {"type": "number"}), this.#p = $ce('p', {}) ); this.update(); this.#a.addEventListener('change', e => { this.a = +e.target.value; }); this.#b.addEventListener('change', e => { this.b = +e.target.value; }); } static observedAttributes = ['a', 'b']; get a() { return +this.getAttribute('a'); } set a(value) { this.setAttribute('a', value); } get b() { return +this.getAttribute('b'); } set b(value) { this.setAttribute('b', value); } attributeChangedCallback() { this.update(); } update() { this.#a.value = this.a; this.#b.value = this.b; this.#raf || (this.#raf = requestAnimationFrame(() => { let {a, b} = this; this.#p.textContent = `${a} + ${b} = ${a + b}`; this.raf = null; })) } } customElements.define('my-adder', Adder);
It's very nitpicky on that point though...
Great point.
Asik seru banget slot gacor di bursa188
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is my take on most of the issues... but I threw it up on my phone.
It's very nitpicky on that point though...
Great point.
Asik seru banget slot gacor di bursa188