Commit be5f695729af5023a684ce8d0be16a9d424ebe98
do not wrap view.close!
Dominic Tarr committed on 5/21/2017, 8:05:05 AMParent: 0e7b1af30dc08c558544f7ca4498fae160f1d155
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -50,9 +50,9 @@ | ||
50 | 50 … | }, |
51 | 51 … | sync: function (fn) { return fn } |
52 | 52 … | } |
53 | 53 … | |
54 | - var o = {ready: ready, since: sv.since, close: wrapper.async(sv.close || function (cb) { return cb() }) } | |
54 … | + var o = {ready: ready, since: sv.since, close: sv.close } | |
55 | 55 … | if(!sv.methods) throw new Error('a stream view must have methods property') |
56 | 56 … | |
57 | 57 … | for(var key in sv.methods) { |
58 | 58 … | var type = sv.methods[key] |
@@ -140,16 +140,22 @@ | ||
140 | 140 … | //then restream each streamview, and callback when it's uptodate with the main log. |
141 | 141 … | }) |
142 | 142 … | }, |
143 | 143 … | close: function (cb) { |
144 | - cont.para(map(views, function (sv) { | |
144 … | + cont.para(map(views, function (sv, k) { | |
145 … | + console.log("CLOSE", k) | |
145 | 146 … | return function (cb) { |
146 | - if(sv.close) sv.close(cb) | |
147 | - else cb() | |
147 … | + if(sv.close) sv.close(_cb) | |
148 … | + else _cb() | |
149 … | + function _cb () { | |
150 … | + console.log("CLOSED!", k) | |
151 … | + cb() | |
152 … | + } | |
148 | 153 … | } |
149 | 154 … | })) (cb) |
150 | 155 … | |
151 | 156 … | } |
152 | 157 … | } |
153 | 158 … | return flume |
154 | 159 … | } |
155 | 160 … | |
161 … | + |
Built with git-ssb-web