Files: afdcd2c2e04a1a406e0fb9e3efbe92ebfd65e1e2 / lib / depject / channel / obs / recent.js
504 bytesRaw
1 | const nest = require('depnest') |
2 | const MutantPullValue = require('../../../mutant-pull-value') |
3 | |
4 | exports.needs = nest({ |
5 | 'sbot.pull.stream': 'first' |
6 | }) |
7 | |
8 | exports.gives = nest({ |
9 | 'channel.obs.recent': true |
10 | }) |
11 | |
12 | exports.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