git ssb

16+

Dominic / patchbay



Tree: 9132118089771e8d960b2590aece46b1b7f121a7

Files: 9132118089771e8d960b2590aece46b1b7f121a7 / app / html / app.js

903 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 'app.sync.window': 'reduce',
12 'history.obs.location': 'first',
13 'history.sync.push': 'first',
14 'settings.sync.get': 'first'
15})
16
17exports.create = function (api) {
18 return nest('app.html.app', app)
19
20 function app () {
21 console.log('STARTING app')
22
23 window = api.app.sync.window(window) // eslint-disable-line no-global-assign
24
25 const initialTabs = api.settings.sync.get('patchbay.defaultTabs')
26 const App = h('App', api.app.html.tabs(initialTabs))
27
28 api.app.sync.initialise(App)
29 // runs all the functions in app/sync/initialise
30
31 api.history.obs.location()(loc => {
32 api.app.sync.goTo(loc || {})
33 })
34
35 return App
36 }
37}
38

Built with git-ssb-web