git ssb

16+

Dominic / patchbay



Tree: 8a51c32a71a79eaf5aacc86fda73831f1a6356dc

Files: 8a51c32a71a79eaf5aacc86fda73831f1a6356dc / app / html / app.js

850 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)
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 => api.app.sync.goTo(loc || {}))
32
33 return App
34 }
35}
36
37

Built with git-ssb-web