git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: 8261134eb7daa7f16ad7f83ebb1549e60b37b70d

Files: 8261134eb7daa7f16ad7f83ebb1549e60b37b70d / components / render_feed.js

467 bytesRaw
1const pull = require('pull-stream')
2const h = require('mutant/h')
3
4exports.needs = {
5 message_render: 'first',
6 sbot_log: 'first'
7}
8
9exports.gives = {
10 render_feed: true
11}
12
13exports.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