diff options
author | Hayleigh Thompson <me@hayleigh.dev> | 2024-05-14 18:21:29 +0200 |
---|---|---|
committer | Hayleigh Thompson <me@hayleigh.dev> | 2024-05-18 09:55:02 +0100 |
commit | 6d164196490e12f3d738d32a2435692fd16f689b (patch) | |
tree | 1efc0b0fce678b91dcda8778ca7340dcd06f5aa2 | |
parent | dee571dd08576221fed28b2851e8dfe26a8129f6 (diff) | |
download | lustre-6d164196490e12f3d738d32a2435692fd16f689b.tar.gz lustre-6d164196490e12f3d738d32a2435692fd16f689b.zip |
:bug: Fixed a bug where components would not properly report attribute changes.
-rw-r--r-- | src/client-component.ffi.mjs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client-component.ffi.mjs b/src/client-component.ffi.mjs index 89e3470..0dfc303 100644 --- a/src/client-component.ffi.mjs +++ b/src/client-component.ffi.mjs @@ -53,11 +53,7 @@ function makeComponent(init, update, view, on_attribute_change) { ); } - if (typeof value === "string") { - this.setAttribute(name, value); - } else { - this[`_${name}`] = value; - } + this[`_${name}`] = value; }, }); }); @@ -74,6 +70,10 @@ function makeComponent(init, update, view, on_attribute_change) { this.appendChild(this.#root); } + attributeChangedCallback(key, _, next) { + this[key] = next; + } + disconnectedCallback() { this.#application.send(new Shutdown()); } |