refactor: move initializeProp to constructor

This commit is contained in:
Ayo 2023-11-19 00:35:07 +01:00
parent 7716348c9f
commit 29c26be58c

View file

@ -101,12 +101,16 @@ export class WebComponent extends HTMLElement {
/** /**
* start HTMLElement callbacks * start HTMLElement callbacks
*/ */
constructor() {
super();
this.#initializeProps();
}
static get observedAttributes() { static get observedAttributes() {
return this.properties; return this.properties;
} }
connectedCallback() { connectedCallback() {
this.#initializeProps();
this.onInit(); this.onInit();
this.render(); this.render();
this.afterViewInit(); this.afterViewInit();