Files: dcb68fb50cc8bee039bf3b455495c4057767384e / example / index.js
767 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.feed.html.render(api.feed.pull.public) |
20 | ]) |
21 | |
22 | document.head.appendChild(h('title', 'PATCHCORE :: Example')) |
23 | document.body.appendChild(app) |
24 | |
25 | function entry (sockets) { |
26 | return { |
27 | feed: { |
28 | html: { |
29 | render: apply.first(sockets.feed.html.render) |
30 | }, |
31 | pull: { |
32 | public: apply.first(sockets.feed.pull.public) |
33 | } |
34 | } |
35 | } |
36 | } |
37 |
Built with git-ssb-web