git ssb

1+

Daan Patchwork / patchwork



Tree: 455af00799601cb57c6ea54edad5e85c516b799f

Files: 455af00799601cb57c6ea54edad5e85c516b799f / lib / plugins / live-backlinks.js

427 bytesRaw
1const pull = require('pull-stream')
2module.exports = function (ssb) {
3 const 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 () {
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