Files: c18b233c6d62741496978cd8dc1f34a093946f8b / feed / html.js
467 bytesRaw
1 | const pull = require('pull-stream') |
2 | const h = require('mutant/h') |
3 | |
4 | exports.needs = { |
5 | message_render: 'first', |
6 | sbot_log: 'first' |
7 | } |
8 | |
9 | exports.gives = { |
10 | render_feed: true |
11 | } |
12 | |
13 | exports.create = function (api) { |
14 | return { |
15 | render_feed |
16 | } |
17 | |
18 | function render_feed (stream) { |
19 | const container = h('div') |
20 | |
21 | pull( |
22 | stream({reverse: true, limit: 100}), |
23 | pull.drain(msg => container.appendChild(api.message_render(msg))) |
24 | ) |
25 | |
26 | return container |
27 | } |
28 | } |
29 |
Built with git-ssb-web