Mercurial > code > home > repos > streamed-graph
comparison src/MultiStore.ts @ 144:379c4294dd0f
patch api
author | drewp@bigasterisk.com |
---|---|
date | Mon, 08 May 2023 13:31:40 -0700 |
parents | 27fad20dc101 |
children | 9347277e8311 |
comparison
equal
deleted
inserted
replaced
143:5adf79d4a9f4 | 144:379c4294dd0f |
---|---|
8 Term, | 8 Term, |
9 extractListOptions, | 9 extractListOptions, |
10 } from "n3"; | 10 } from "n3"; |
11 import * as RDF from "rdf-js"; | 11 import * as RDF from "rdf-js"; |
12 import { SubEvent } from "sub-events"; | 12 import { SubEvent } from "sub-events"; |
13 import { Patch } from "./Patch"; | 13 import { Patch, PatchDirection } from "./Patch"; |
14 import { SourceGraph } from "./SourceGraph"; | 14 import { SourceGraph } from "./SourceGraph"; |
15 | 15 |
16 // queries over multiple Store objects | 16 // queries over multiple Store objects |
17 export class MultiStore implements Store { | 17 export class MultiStore implements Store { |
18 // emitted when there's been a net change to the graph data | 18 // emitted when there's been a net change to the graph data |
26 this.tempCombinedGraph = new Store(); | 26 this.tempCombinedGraph = new Store(); |
27 } | 27 } |
28 | 28 |
29 newStore(s: SourceGraph) { | 29 newStore(s: SourceGraph) { |
30 this.stores.push(s.store); | 30 this.stores.push(s.store); |
31 const p = new Patch(); // todo | 31 const p = new Patch(PatchDirection.ADD); // todo |
32 s.sourceGraphChanged.subscribe((p) => { | 32 s.sourceGraphChanged.subscribe((p) => { |
33 this.sourceGraphDataChanged(p); // todo | 33 this.sourceGraphDataChanged(p); // todo |
34 }); | 34 }); |
35 } | 35 } |
36 | 36 |