git ssb

16+

Dominic / patchbay



Tree: 4f805f442d6775913d8beb9c969b08250e508767

Files: 4f805f442d6775913d8beb9c969b08250e508767 / router / html / page / notifications.js

974 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')
7exports.needs = nest({
8 'feed.pull': {
9 mentions: 'first',
10 public: 'first'
11 },
12 'keys.sync.id': 'first',
13 'main.html.scroller': 'first',
14 'message.html.render': 'first'
15})
16exports.create = function (api) {
17 return nest('router.html.page', (path) => {
18 if (path !== '/notifications') return
19 const id = api.keys.sync.id()
20 const mentions = api.feed.pull.mentions(id)
21
22 const { container, content } = api.main.html.scroller({})
23
24 pull(
25 next(mentions, {old: false, limit: 100}),
26 Scroller(container, content, api.message.html.render, true, false)
27 )
28
29 pull(
30 next(mentions, {reverse: true, limit: 100, live: false}),
31 Scroller(container, content, api.message.html.render, false, false)
32 )
33 return container
34 })
35}
36
37

Built with git-ssb-web