Mercurial > code > home > repos > homeauto
diff service/wifi/src/index.ts @ 674:2b9865bf1737
streamed-graph finally imports and builds. polymer bindings don't work in a <dom-bind> though
Ignore-this: afcf4436ac3d7b88c0d7fc88de81d8e4
author | drewp@bigasterisk.com |
---|---|
date | Thu, 02 Jan 2020 00:23:36 -0800 |
parents | f2215949c0c9 |
children | 9ae34280218b |
line wrap: on
line diff
--- a/service/wifi/src/index.ts Tue Dec 31 02:45:25 2019 -0800 +++ b/service/wifi/src/index.ts Thu Jan 02 00:23:36 2020 -0800 @@ -1,28 +1,37 @@ -console.log('p-1'); -import { PolymerElement, html } from '@polymer/polymer'; -import { customElement, property, computed } from '@polymer/decorators'; -import { N3Store } from "n3" +import { PolymerElement, html } from "@polymer/polymer"; +import { + customElement, + property, + computed, + observe, +} from "@polymer/decorators"; +import { N3Store } from "n3"; //import {* as wt} from './wifi-table'; import { VersionedGraph, StreamedGraph } from "streamed-graph"; -export {DomBind} from '@polymer/polymer/lib/elements/dom-bind.js'; -console.log('p0'); -console.log('p1', StreamedGraph.name); -@customElement('wifi-display') +export { DomBind } from "@polymer/polymer/lib/elements/dom-bind.js"; + +console.log("here is a real dependency on ", StreamedGraph.name); + +@customElement("wifi-display") class WifiDisplay extends PolymerElement { + @property({ type: Object, observer: WifiDisplay.prototype.onGraphChanged}) + graph!: VersionedGraph; - @property({ type: Object }) - graph!: StreamedGraph; + + onGraphChanged() { + console.log("new graph", this.graph); + } - ready() { - super.ready(); - console.log('p2'); - // this.graph.addEventListener('change', this.redraw.bind(this)); - } - // redraw() { - // wt.render(this.graph.graph); - // } - static get template() { - return html`here`; - } + ready() { + super.ready(); + } + + // redraw() { + // wt.render(this.graph.graph); + // } + static get template() { + return html` + here + `; + } } -console.log('p3'); \ No newline at end of file