comparison src/MultiStore.ts @ 141:27fad20dc101

rm logging
author drewp@bigasterisk.com
date Mon, 08 May 2023 13:05:59 -0700
parents 5a1a79f54779
children 379c4294dd0f
comparison
equal deleted inserted replaced
140:2ad4784c0d6c 141:27fad20dc101
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(); // todo
32 s.sourceGraphChanged.subscribe((p) => { 32 s.sourceGraphChanged.subscribe((p) => {
33 console.log("patchlife1: ");
34 this.sourceGraphDataChanged(p); // todo 33 this.sourceGraphDataChanged(p); // todo
35 }); 34 });
36 } 35 }
37 36
38 lostStore(s: Store) { 37 lostStore(s: Store) {
39 throw new Error("notimplemented"); 38 throw new Error("notimplemented");
40 } 39 }
41 40
42 sourceGraphDataChanged(p: Patch) { 41 sourceGraphDataChanged(p: Patch) {
43 console.log("patchlife2: multistore saw a graph change", p);
44 42
45 this.tempCombinedGraph = new Store(); 43 this.tempCombinedGraph = new Store();
46 for (let st of this.stores) { 44 for (let st of this.stores) {
47 for (let q of st.getQuads(null, null, null, null)) { 45 for (let q of st.getQuads(null, null, null, null)) {
48 this.tempCombinedGraph.addQuad(q); 46 this.tempCombinedGraph.addQuad(q);
49 } 47 }
50 } 48 }
51 console.log("patchlife3: tempgraph is rebuilt");
52 this.graphChanged.emit(p); 49 this.graphChanged.emit(p);
53 } 50 }
54 51
55 // 52 //
56 // Store interface follows: 53 // Store interface follows: