git ssb

16+

Dominic / patchbay



Tree: bd411fd1d719442e7658db49d6b8c5d22b10fb25

Files: bd411fd1d719442e7658db49d6b8c5d22b10fb25 / main / html / app.js

838 bytesRaw
1const { Value, h } = require('mutant')
2const nest = require('depnest')
3const insertCss = require('insert-css')
4
5exports.gives = nest('main.html.app')
6
7exports.needs = nest({
8 'router.html.page': 'first',
9 'styles.css': 'reduce'
10})
11
12exports.create = function (api) {
13 return nest('main.html.app', app)
14
15 function app () {
16 const css = values(api.styles.css()).join('\n')
17 insertCss(css)
18
19 // var view = Value(getView())
20 var view = 'hello!'
21 var screen = h('App', view)
22
23 // window.onhashchange = () => view.set(getView())
24 // document.body.appendChild(screen)
25
26 return screen
27 }
28
29 // function getView () {
30 // const view = window.location.hash.substring(1) || 'tabs'
31 // return api.page(view)
32 // }
33}
34
35function values (object) {
36 const keys = Object.keys(object)
37 return keys.map(k => object[k])
38}
39
40

Built with git-ssb-web