aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client-component.ffi.mjs10
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());
}