added base element
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
export class BaseElement extends HTMLElement {
|
||||
private _hasConnectedCallback: boolean = false;
|
||||
connectedCallback() {
|
||||
|
||||
if (!this._hasConnectedCallback) {
|
||||
this.onInit();
|
||||
}
|
||||
else {
|
||||
this.onUpdate();
|
||||
}
|
||||
|
||||
this._hasConnectedCallback = true;
|
||||
|
||||
}
|
||||
|
||||
onInit() { }
|
||||
onUpdate() { }
|
||||
}
|
||||
Reference in New Issue
Block a user