git ssb

2+

Dominic / flumedb



Commit be5f695729af5023a684ce8d0be16a9d424ebe98

do not wrap view.close!

Dominic Tarr committed on 5/21/2017, 8:05:05 AM
Parent: 0e7b1af30dc08c558544f7ca4498fae160f1d155

Files changed

index.jschanged
index.jsView
@@ -50,9 +50,9 @@
5050 },
5151 sync: function (fn) { return fn }
5252 }
5353
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 }
5555 if(!sv.methods) throw new Error('a stream view must have methods property')
5656
5757 for(var key in sv.methods) {
5858 var type = sv.methods[key]
@@ -140,16 +140,22 @@
140140 //then restream each streamview, and callback when it's uptodate with the main log.
141141 })
142142 },
143143 close: function (cb) {
144- cont.para(map(views, function (sv) {
144 + cont.para(map(views, function (sv, k) {
145 + console.log("CLOSE", k)
145146 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 + }
148153 }
149154 })) (cb)
150155
151156 }
152157 }
153158 return flume
154159 }
155160
161 +

Built with git-ssb-web