git ssb

1+

Daan Patchwork / patchwork



Tree: 58ab0241031aa549a35cce1e678c27065ae66221

Files: 58ab0241031aa549a35cce1e678c27065ae66221 / lib / plugins / recent-feeds.js

597 bytesRaw
1const pull = require('pull-stream')
2const pullCat = require('pull-cat')
3
4module.exports = function (sbot) {
5 return {
6 stream: function ({ live = null, since = null } = {}) {
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