git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Tree: f06d537e3a5dcdce8c60eb9c129923924e3d7326

Files: f06d537e3a5dcdce8c60eb9c129923924e3d7326 / sbot / recent-feeds.js

579 bytesRaw
1var pull = require('pull-stream')
2var pullCat = require('pull-cat')
3
4module.exports = function (sbot, config) {
5 return {
6 stream: function ({live, since} = {}) {
7 return pullCat([
8 pull(
9 sbot.createFeedStream({reverse: true, gt: since}),
10 pull.map(msg => msg.value.author),
11 pull.unique()
12 ),
13
14 // live
15 live ? pull.values([{sync: true}]) : pull.empty(),
16 live ? pull(
17 sbot.createFeedStream({old: false}),
18 pull.map(msg => msg.value.author)
19 ) : pull.empty()
20 ])
21 }
22 }
23}
24

Built with git-ssb-web