git ssb

16+

Dominic / patchbay



Tree: 8ae0df05df1185783cf0ee77113ce4bcc4531bdd

Files: 8ae0df05df1185783cf0ee77113ce4bcc4531bdd / router / html / page / public.js

1063 bytesRaw
1const nest = require('depnest')
2const pull = require('pull-stream')
3const Scroller = require('pull-scroll')
4const next = require('../../../junk/next-stepper')
5
6exports.gives = nest('router.html.page')
7
8exports.needs = nest({
9 'feed.pull.public': 'first',
10 'message.html': {
11 compose: 'first',
12 render: 'first'
13 },
14 'main.html.scroller': 'first'
15})
16
17exports.create = function (api) {
18 return nest('router.html.page', publicPage)
19
20 function publicPage (path) {
21 if (path !== '/public') return
22
23 const composer = api.message.html.compose({
24 meta: { type: 'post' },
25 placeholder: 'Write a public message'
26 })
27 const { container, content } = api.main.html.scroller({ prepend: composer })
28
29 pull(
30 next(api.feed.pull.public, {old: false, limit: 100}),
31 Scroller(container, content, api.message.html.render, true, false)
32 )
33
34 pull(
35 next(api.feed.pull.public, {reverse: true, limit: 100, live: false}),
36 Scroller(container, content, api.message.html.render, false, false)
37 )
38
39 return container
40 }
41}
42
43

Built with git-ssb-web