git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: 5cea9df7483c8eadbe82003ae98e7bd65ad305ac

Files: 5cea9df7483c8eadbe82003ae98e7bd65ad305ac / feed / pull / type.js

575 bytesRaw
1const nest = require('depnest')
2const extend = require('xtend')
3
4exports.gives = nest('feed.pull.type')
5exports.needs = nest('sbot.pull.messagesByType', 'first')
6exports.create = function (api) {
7 return nest('feed.pull.type', (type) => {
8 if (typeof type !== 'string') throw new Error('a type must be specified')
9
10 return function (opts) {
11 opts = extend(opts, {
12 type,
13 // handle last item passed in as lt
14 lt: typeof opts.lt === 'object' ? opts.lt.timestamp : opts.lt
15 })
16
17 return api.sbot.pull.messagesByType(opts)
18 }
19 })
20}
21

Built with git-ssb-web