git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: 8a6dee20553eb2c7dc78f6ae843306099b24b093

Files: 8a6dee20553eb2c7dc78f6ae843306099b24b093 / feed / pull / public.js

580 bytesRaw
1const nest = require('depnest')
2var pull = require('pull-stream')
3
4exports.gives = nest('feed.pull.public')
5exports.needs = nest({
6 'sbot.pull.feed': 'first',
7 'message.sync.isBlocked': 'first',
8 'message.sync.timestamp': 'first'
9})
10
11exports.create = function (api) {
12 return nest('feed.pull.public', (opts) => {
13 // handle last item passed in as lt
14 opts.lt = (opts.lt && opts.lt.value)
15 ? api.message.sync.timestamp(opts.lt)
16 : opts.lt
17
18 return pull(
19 api.sbot.pull.feed(opts),
20 pull.filter(msg => !api.message.sync.isBlocked(msg))
21 )
22 })
23}
24

Built with git-ssb-web