git ssb

9+

cel / ssb-viewer



Commit 7435396e3180a59a47f4a1e77896c4090816c5f4

Use pull.take

cel committed on 4/20/2017, 9:03:41 PM
Parent: b415e82d715287a48617deafbf2edff6d9ca48f1

Files changed

index.jschanged
index.jsView
@@ -177,18 +177,8 @@
177177 })
178178 )
179179 }
180180
181- function take (n) {
182- return function (read) {
183- return function (abort, cb) {
184- //after n reads, tell the source to abort!
185- if(!n--) return read(true, cb)
186- read(null, cb)
187- }
188- }
189- }
190-
191181 function serveFeeds(req, res, following, channelSubscriptions, feedId) {
192182 var opts = defaultOpts
193183
194184 opts.marked = {
@@ -210,9 +200,9 @@
210200 return !msg.value ||
211201 (msg.value.author in following ||
212202 msg.value.content.channel in channelSubscriptions)
213203 }),
214- take(100),
204 + pull.take(2),
215205 pull.collect(function (err, logs) {
216206 if (err) return respond(res, 500, err.stack || err)
217207 res.writeHead(200, {
218208 'Content-Type': ctype("html")

Built with git-ssb-web