git ssb

1+

Daan Patchwork / patchwork



Tree: 2aba282967b6a030aeb637a4592a0572ac1451b7

Files: 2aba282967b6a030aeb637a4592a0572ac1451b7 / 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