fix(core): update

This commit is contained in:
2020-12-07 03:30:59 +00:00
parent a0e7ef2beb
commit 6301d827e1
4 changed files with 39 additions and 21 deletions

View File

@ -1,3 +1,11 @@
// pushrocks scope
import * as smartrx from '@pushrocks/smartrx';
export {
smartrx
};
// third party scope
import { LitElement, property } from 'lit-element';
const litElement = {
LitElement,

View File

@ -15,13 +15,21 @@ export class DeesElement extends plugins.litElement.LitElement {
public goBright: boolean = false;
public domtoolsPromise = plugins.domtools.elementBasic.setup(this);
private themeSubscription: plugins.smartrx.rxjs.Subscription;
public connectedCallback() {
super.connectedCallback();
this.dispatchEvent(new CustomEvent('domtools-connected'));
this.domtoolsPromise.then(async (domtools) => {
this.themeSubscription = domtools.themeManager.themeObservable.subscribe(goBrightArg => {
this.goBright = goBrightArg;
});
});
this.dispatchEvent(new CustomEvent('deesElementConnected'));
}
public disconnectedCallback() {
super.disconnectedCallback();
this.dispatchEvent(new CustomEvent('domtools-disconnected'));
this.themeSubscription.unsubscribe();
this.dispatchEvent(new CustomEvent('deesElementDisconnected'));
}
}