git ssb

3+

arj / patchbook



Tree: 40aa5761d29866aa4ab08ff139a33262cbc14177

Files: 40aa5761d29866aa4ab08ff139a33262cbc14177 / book / pull / getAll.js

582 bytesRaw
1const pull = require('pull-stream')
2const nest = require('depnest')
3
4exports.gives = nest({
5 'book.pull.getAll': true
6 // this style is easier to search for IMO
7})
8
9exports.needs = nest({
10 'sbot.pull.messagesByType': 'first'
11})
12
13exports.create = function (api) {
14 return nest({ 'book.pull.getAll': getAll })
15
16 function getAll() {
17 // we can trust this returns a pull stream alread because it's sbot.pull.*
18 return api.sbot.pull.messagesByType({ type: 'bookclub', fillCache: true,
19 keys: true, reverse: true, live: true })
20 }
21}
22

Built with git-ssb-web