dees-element/ts/index.ts
2020-12-07 03:30:59 +00:00

35 lines
981 B
TypeScript

import * as plugins from './dees-element.plugins';
export {
property,
html,
customElement,
TemplateResult,
internalProperty,
css,
unsafeCSS
} from 'lit-element';
export class DeesElement extends plugins.litElement.LitElement {
@plugins.litElement.property({type: Boolean})
public goBright: boolean = false;
public domtoolsPromise = plugins.domtools.elementBasic.setup(this);
private themeSubscription: plugins.smartrx.rxjs.Subscription;
public connectedCallback() {
super.connectedCallback();
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.themeSubscription.unsubscribe();
this.dispatchEvent(new CustomEvent('deesElementDisconnected'));
}
}