fix(core): update
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@design.estate/dees-element',
|
||||
version: '2.0.33',
|
||||
version: '2.0.34',
|
||||
description: 'a custom element class extending lit element class'
|
||||
}
|
||||
|
@ -32,6 +32,9 @@ export class DeesElement extends plugins.lit.LitElement {
|
||||
this.goBright = goBrightArg;
|
||||
});
|
||||
this.rxSubscriptions.push(this.themeSubscription);
|
||||
for (const startupFunction of this.startupFunctions) {
|
||||
await startupFunction();
|
||||
}
|
||||
this.dispatchEvent(new CustomEvent('deesElementConnected'));
|
||||
}
|
||||
|
||||
@ -40,7 +43,12 @@ export class DeesElement extends plugins.lit.LitElement {
|
||||
this.elementDomReadyDeferred.resolve();
|
||||
}
|
||||
|
||||
private garbageFunctions: (() => void)[] = [];
|
||||
private startupFunctions: (() => void | Promise<any>)[] = [];
|
||||
public registerStartupFunction(startupFunctionArg: () => void) {
|
||||
this.startupFunctions.push(startupFunctionArg);
|
||||
}
|
||||
|
||||
private garbageFunctions: (() => void | Promise<any>)[] = [];
|
||||
public registerGarbageFunction(garbageFunctionArg: () => void) {
|
||||
this.garbageFunctions.push(garbageFunctionArg);
|
||||
}
|
||||
@ -52,7 +60,7 @@ export class DeesElement extends plugins.lit.LitElement {
|
||||
subscription.unsubscribe();
|
||||
}
|
||||
for (const garbageFunction of this.garbageFunctions) {
|
||||
garbageFunction();
|
||||
await garbageFunction();
|
||||
}
|
||||
this.dispatchEvent(new CustomEvent('deesElementDisconnected'));
|
||||
}
|
||||
|
Reference in New Issue
Block a user