git ssb

16+

Dominic / patchbay



Tree: c40144a5b06d37566f63d1a99cc5c0c482c7d2be

Files: c40144a5b06d37566f63d1a99cc5c0c482c7d2be / app / html / app.js

803 bytesRaw
1const nest = require('depnest')
2const { h } = require('mutant')
3
4exports.gives = nest('app.html.app')
5
6exports.needs = nest({
7 'app.html.tabs': 'first',
8 'app.page.errors': 'first',
9 'app.sync.goTo': 'first',
10 'app.sync.initialise': 'first',
11 'history.obs.location': 'first',
12 'history.sync.push': 'first',
13 'settings.sync.get': 'first'
14})
15
16exports.create = function (api) {
17 return nest('app.html.app', app)
18
19 function app (initialTabs) {
20 console.log('STARTING app')
21
22 const App = h('App', api.app.html.tabs({
23 initial: initialTabs || api.settings.sync.get('patchbay.defaultTabs')
24 }))
25
26 api.app.sync.initialise(App)
27 // runs all the functions in app/sync/initialise
28
29 api.history.obs.location()(loc => {
30 api.app.sync.goTo(loc || {})
31 })
32
33 return App
34 }
35}
36

Built with git-ssb-web