git ssb

16+

Dominic / patchbay



Tree: ce182a6ed828db9aa940f352cf28de6409530165

Files: ce182a6ed828db9aa940f352cf28de6409530165 / app / html / app.js

939 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 'settings.sync.set': 'first'
16})
17
18exports.create = function (api) {
19 return nest('app.html.app', app)
20
21 function app () {
22 console.log('STARTING app')
23
24 window = api.app.sync.window(window)
25
26 const initialTabs = ['/settings','/public', '/inbox', '/notifications'] // NB router converts these to { page: '/public' }
27 const App = h('App', api.app.html.tabs(initialTabs))
28
29 api.app.sync.initialise(App)
30 // runs all the functions in app/sync/initialise
31
32 api.history.obs.location()(loc => api.app.sync.goTo(loc || {}))
33
34 return App
35 }
36}
37
38

Built with git-ssb-web