diff --git a/light9/web/GraphAwarePage.ts b/light9/web/GraphAwarePage.ts new file mode 100644 --- /dev/null +++ b/light9/web/GraphAwarePage.ts @@ -0,0 +1,25 @@ +import debug from "debug"; +import { html, LitElement } from "lit"; +import { patchSizeSummary } from "../web/patch"; +import { GraphChangedEvent } from "../web/RdfdbSyncedGraph"; +import { SyncedGraph } from "./SyncedGraph"; + +const log = debug("graphaware"); + +export class GraphAwarePage extends LitElement { + constructor() { + super(); + this.classList.add("graph-events"); + } + // prepend this to your subclass's render output, like + // render() { return html`${super.render()} ....your page`; } + render() { + return html``; + } + onGraphChanged(ev: GraphChangedEvent) { + log("patch from server [3]", patchSizeSummary(ev.detail.patch)); + // this.dispatchEvent(new CustomEvent("changed", { detail: ev.detail })); + log("patch from server [4]"); + } +} +