fix(core): update

This commit is contained in:
Philipp Kunz 2020-12-07 22:56:24 +00:00
parent a322c9a929
commit d5872511b8

View File

@ -7,20 +7,32 @@ export {
TemplateResult, TemplateResult,
internalProperty, internalProperty,
css, css,
unsafeCSS unsafeCSS,
} from 'lit-element'; } from 'lit-element';
export class DeesElement extends plugins.litElement.LitElement { export class DeesElement extends plugins.litElement.LitElement {
@plugins.litElement.property({type: Boolean}) @plugins.litElement.property({ type: Boolean })
public goBright: boolean = false; public goBright: boolean = false;
// domtools
public domtoolsPromise = plugins.domtools.elementBasic.setup(this); public domtoolsPromise = plugins.domtools.elementBasic.setup(this);
@plugins.litElement.property()
domtools?: plugins.domtools.DomTools;
private themeSubscription: plugins.smartrx.rxjs.Subscription; private themeSubscription: plugins.smartrx.rxjs.Subscription;
constructor() {
super();
this.domtoolsPromise.then((domtoolsArg) => {
this.domtools = domtoolsArg;
});
}
public connectedCallback() { public connectedCallback() {
super.connectedCallback(); super.connectedCallback();
this.domtoolsPromise.then(async (domtools) => { this.domtoolsPromise.then(async (domtools) => {
this.themeSubscription = domtools.themeManager.themeObservable.subscribe(goBrightArg => { this.themeSubscription = domtools.themeManager.themeObservable.subscribe((goBrightArg) => {
this.goBright = goBrightArg; this.goBright = goBrightArg;
}); });
}); });
@ -32,4 +44,4 @@ export class DeesElement extends plugins.litElement.LitElement {
this.themeSubscription.unsubscribe(); this.themeSubscription.unsubscribe();
this.dispatchEvent(new CustomEvent('deesElementDisconnected')); this.dispatchEvent(new CustomEvent('deesElementDisconnected'));
} }
} }