git ssb

16+

Dominic / patchbay



Tree: 5a871755c2cc2fd5aab4e83d3ce13641d29ac377

Files: 5a871755c2cc2fd5aab4e83d3ce13641d29ac377 / app / sync / start.js

897 bytesRaw
1const nest = require('depnest')
2
3exports.gives = nest('app.sync.start')
4
5exports.needs = nest({
6 'app.html.app': 'first',
7 'app.page.errors': 'first',
8 'app.sync.goTo': 'first',
9 'app.sync.initialise': 'first',
10 'config.sync.load': 'first',
11 'history.obs.location': 'first',
12 'history.sync.push': 'first',
13 'settings.sync.get': 'first',
14 'sbot.async.run': 'first'
15})
16
17exports.create = function (api) {
18 return nest('app.sync.start', start)
19
20 function start (opts = {}) {
21 console.log('STARTING Patchbay UI')
22
23 const App = api.app.html.app(opts.initialTabs)
24
25 api.app.sync.initialise(App, api.config.sync.load())
26 // runs all the functions in app/sync/initialise
27
28 api.history.obs.location()(api.app.sync.goTo)
29
30 api.sbot.async.run(server => {
31 server.whoami((err, data) => {
32 if (err) throw err
33 document.body.appendChild(App)
34 })
35 })
36 }
37}
38

Built with git-ssb-web