Files: 0baf5414ce7a4d8be1f75148ec7dce869d876d66 / feed / html.js
524 bytesRaw
1 | const pull = require('pull-stream') |
2 | const h = require('mutant/h') |
3 | const nest = require('depnest') |
4 | |
5 | exports.needs = nest({ |
6 | 'message.html.render': 'first', |
7 | 'sbot.pull.log': 'first' |
8 | }) |
9 | |
10 | exports.gives = nest('feed.html.render') |
11 | |
12 | exports.create = function (api) { |
13 | return nest('feed.html.render', function renderFeed (stream) { |
14 | const container = h('div') |
15 | |
16 | pull( |
17 | stream({reverse: true, limit: 100}), |
18 | pull.drain(msg => container.appendChild(api.message.html.render(msg))) |
19 | ) |
20 | |
21 | return container |
22 | } |
23 | } |
24 |
Built with git-ssb-web