_base.ts

18 lines | 349 B Blame History Raw Download
export class BaseElement extends HTMLElement {
    private _hasConnectedCallback: boolean = false;
    connectedCallback() {

        if (!this._hasConnectedCallback) {
            this.onInit();
        }
        else {
            this.onUpdate();
        }

        this._hasConnectedCallback = true;

    }

    onInit() { }
    onUpdate() { }
}