feat: initial attach effect

This commit is contained in:
Ayo 2023-12-01 08:41:10 +01:00
parent cb8cba3c22
commit 2f01c4632c

View file

@ -95,7 +95,7 @@ export class WebComponent extends HTMLElement {
this[property] = currentValue === "" || currentValue; this[property] = currentValue === "" || currentValue;
this[camelCaps] = this[property]; // remove on v2 this[camelCaps] = this[property]; // remove on v2
this.#handleUpdateProp(camelCaps, currentValue); this.#handleUpdateProp(camelCaps, this[property]);
this.render(); this.render();
this.onChanges({ property, previousValue, currentValue }); this.onChanges({ property, previousValue, currentValue });
@ -161,8 +161,11 @@ export class WebComponent extends HTMLElement {
return true; return true;
}, },
get(obj, prop) { get(obj, prop) {
Object.getPrototypeOf(obj[prop]).proxy = meta.#props; // TODO: handle non-objects
Object.getPrototypeOf(obj[prop]).prop = prop; if(obj[prop] !== null && obj[prop] !== undefined) {
Object.getPrototypeOf(obj[prop]).proxy = meta.#props;
Object.getPrototypeOf(obj[prop]).prop = prop;
}
return obj[prop]; return obj[prop];
}, },
}; };