Files: ce375da17a50a713361509fbf70ff5ccf225d1f4 / modules / data-feed.js
851 bytesRaw
1 | var h = require('hyperscript') |
2 | var u = require('patchbay/util') |
3 | var pull = require('pull-stream') |
4 | var Scroller = require('pull-scroll') |
5 | |
6 | var plugs = require('patchbay/plugs') |
7 | var sbot_log = plugs.first(exports.sbot_log = []) |
8 | var data_render = plugs.first(exports.data_render = []) |
9 | |
10 | exports.screen_view = function (path, sbot) { |
11 | if(path === '/data-feed' || path === '/data') { |
12 | var content = h('div.column.scroller__content') |
13 | var div = h('div.column.scroller', |
14 | {style: {'overflow':'auto'}}, |
15 | h('div.scroller__wrapper', |
16 | content |
17 | ) |
18 | ) |
19 | |
20 | pull( |
21 | u.next(sbot_log, {old: false, limit: 100}), |
22 | Scroller(div, content, data_render, true, false) |
23 | ) |
24 | |
25 | pull( |
26 | u.next(sbot_log, {reverse: true, limit: 100, live: false}), |
27 | Scroller(div, content, data_render, false, false) |
28 | ) |
29 | |
30 | return div |
31 | } |
32 | } |
33 |
Built with git-ssb-web