git ssb

1+

Daan Patchwork / patchwork



Tree: afdcd2c2e04a1a406e0fb9e3efbe92ebfd65e1e2

Files: afdcd2c2e04a1a406e0fb9e3efbe92ebfd65e1e2 / lib / depject / channel / obs / recent.js

504 bytesRaw
1const nest = require('depnest')
2const MutantPullValue = require('../../../mutant-pull-value')
3
4exports.needs = nest({
5 'sbot.pull.stream': 'first'
6})
7
8exports.gives = nest({
9 'channel.obs.recent': true
10})
11
12exports.create = function (api) {
13 return nest({
14 'channel.obs.recent': function (limit) {
15 return MutantPullValue(() => {
16 return api.sbot.pull.stream((sbot) => sbot.patchwork.channels.recentStream({ limit: limit || 10 }))
17 }, { defaultValue: [], sync: true })
18 }
19 })
20}
21

Built with git-ssb-web