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