Files: 690dd9cfc439a37ed03576874767a7135fc3356e / app / html / app.js
850 bytesRaw
1 | const nest = require('depnest') |
2 | const { h } = require('mutant') |
3 | |
4 | exports.gives = nest('app.html.app') |
5 | |
6 | exports.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 | |
17 | exports.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