Mercurial > code > home > repos > streamed-graph
diff src/streamed_graph_client.ts @ 20:9ec3cbc8791a
build is running, but no tests, and lots of code is disabled
author | drewp@bigasterisk.com |
---|---|
date | Fri, 13 Dec 2019 01:18:00 -0800 |
parents | 7ca4ff2088c3 |
children | 8b4dc9e87b56 |
line wrap: on
line diff
--- a/src/streamed_graph_client.ts Thu Dec 12 23:07:06 2019 -0800 +++ b/src/streamed_graph_client.ts Fri Dec 13 01:18:00 2019 -0800 @@ -1,7 +1,7 @@ // from /my/site/homepage/www/rdf/streamed-graph.js import { eachJsonLdQuad } from "./json_ld_quads"; -import { N3Store } from '../node_modules/@types/n3/index'; +import { N3Store } from 'n3'; import { Store } from 'n3'; export class StreamedGraphClient { @@ -11,7 +11,7 @@ onStatus: (msg: string) => void; onGraphChanged: () => void; store: N3Store; - events: EventSource; + events!: EventSource; constructor( eventsUrl: string, onGraphChanged: () => void, @@ -71,14 +71,14 @@ this.events.addEventListener('fullGraph', async (ev) => { this.onStatus('sync- full graph update'); - await this.replaceFullGraph(ev.data); + await this.replaceFullGraph((ev as MessageEvent).data); this.onStatus(`synced ${this.store.size}`); this.onGraphChanged(); }); this.events.addEventListener('patch', async (ev) => { this.onStatus('sync- updating'); - await this.patchGraph(ev.data); + await this.patchGraph((ev as MessageEvent).data); this.onStatus(`synced ${this.store.size}`); this.onGraphChanged(); });