Files: adf8a7771064a6d9a18b6005e625fadbd6fb9846 / example / index.js
711 bytesRaw
1 | const combine = require('depject') |
2 | const apply = require('depject/apply') |
3 | const h = require('mutant/h') |
4 | const fs = require('fs') |
5 | |
6 | const modules = require('../') |
7 | var api = entry(combine(modules)) |
8 | |
9 | // TODO depject.entry(sockets, { |
10 | // render_feed: 'first', |
11 | // feeds: { |
12 | // public: 'first' |
13 | // } |
14 | // })() |
15 | |
16 | require('insert-css')(fs.readFileSync(__dirname + '/styles.css', 'utf8')) |
17 | |
18 | var app = h('div.App', [ |
19 | api.render_feed(api.streams.public) |
20 | ]) |
21 | |
22 | document.head.appendChild(h('title', 'PATCHCORE :: Example')) |
23 | document.body.appendChild(app) |
24 | |
25 | function entry (sockets) { |
26 | return { |
27 | render_feed: apply.first(sockets.render_feed), |
28 | streams: { |
29 | public: apply.first(sockets.streams.public) |
30 | } |
31 | } |
32 | } |
33 |
Built with git-ssb-web