From 7435396e3180a59a47f4a1e77896c4090816c5f4 Mon Sep 17 00:00:00 2001 From: cel Date: Thu, 20 Apr 2017 14:03:41 -0700 Subject: [PATCH] Use pull.take --- index.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/index.js b/index.js index a08f680..0217bfd 100644 --- a/index.js +++ b/index.js @@ -178,16 +178,6 @@ exports.init = function (sbot, config) { ) } - function take (n) { - return function (read) { - return function (abort, cb) { - //after n reads, tell the source to abort! - if(!n--) return read(true, cb) - read(null, cb) - } - } - } - function serveFeeds(req, res, following, channelSubscriptions, feedId) { var opts = defaultOpts @@ -211,7 +201,7 @@ exports.init = function (sbot, config) { (msg.value.author in following || msg.value.content.channel in channelSubscriptions) }), - take(100), + pull.take(2), pull.collect(function (err, logs) { if (err) return respond(res, 500, err.stack || err) res.writeHead(200, {