git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Tree: dbcaed4a38e2a45014c7a8a7e73a0b5e53164c31

Files: dbcaed4a38e2a45014c7a8a7e73a0b5e53164c31 / sbot / live-backlinks.js

431 bytesRaw
1var pull = require('pull-stream')
2module.exports = function (ssb, config) {
3 var subscriptions = new Set()
4 return {
5 subscribe: function (id) {
6 subscriptions.add(id)
7 },
8 unsubscribe: function (id) {
9 subscriptions.delete(id)
10 },
11 stream: function (id) {
12 return pull(
13 ssb.backlinks.read({old: false, index: 'DTS'}),
14 pull.filter(x => subscriptions.has(x.dest))
15 )
16 }
17 }
18}
19

Built with git-ssb-web