fix(core): update
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@designestate/dees-element',
|
||||
version: '2.0.19',
|
||||
version: '2.0.20',
|
||||
description: 'a custom element class extending lit element class'
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ export class DeesElement extends plugins.lit.LitElement {
|
||||
@plugins.lit.property()
|
||||
domtools?: plugins.domtools.DomTools;
|
||||
|
||||
public rxSubscriptions: plugins.smartrx.rxjs.Subscription[] = [];
|
||||
private themeSubscription: plugins.smartrx.rxjs.Subscription;
|
||||
|
||||
private elementDomReadyDeferred = plugins.domtools.plugins.smartpromise.defer();
|
||||
@ -30,6 +31,7 @@ export class DeesElement extends plugins.lit.LitElement {
|
||||
this.themeSubscription = domtools.themeManager.themeObservable.subscribe((goBrightArg) => {
|
||||
this.goBright = goBrightArg;
|
||||
});
|
||||
this.rxSubscriptions.push(this.themeSubscription);
|
||||
this.dispatchEvent(new CustomEvent('deesElementConnected'));
|
||||
}
|
||||
|
||||
@ -41,7 +43,9 @@ export class DeesElement extends plugins.lit.LitElement {
|
||||
public async disconnectedCallback() {
|
||||
await this.domtoolsPromise;
|
||||
super.disconnectedCallback();
|
||||
this.themeSubscription.unsubscribe();
|
||||
for (const subscription of this.rxSubscriptions) {
|
||||
subscription.unsubscribe();
|
||||
}
|
||||
this.dispatchEvent(new CustomEvent('deesElementDisconnected'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user