Files: 261718c426b0d5a333dfa4acc00aacf92c5fe394 / ui.js
734 bytesRaw
1 | const combine = require('depject') |
2 | const entry = require('depject/entry') |
3 | const nest = require('depnest') |
4 | const values = require('lodash/values') |
5 | |
6 | const { patchcore, patchbay, plugins, configModule } = require('./exports') |
7 | |
8 | function Start (config) { |
9 | if (!config) throw new Error('patchbay/ui.js needs to be provided with a valid server config') |
10 | |
11 | // polyfills |
12 | require('setimmediate') |
13 | |
14 | const sockets = combine( |
15 | ...values(plugins), // TODO spin up settings check which modules are wanted |
16 | configModule(config), |
17 | patchbay, |
18 | patchcore |
19 | ) |
20 | // plugins loaded first will over-ride core modules loaded later |
21 | |
22 | const api = entry(sockets, nest('app.sync.start', 'first')) |
23 | api.app.sync.start() |
24 | } |
25 | |
26 | module.exports = Start |
27 |
Built with git-ssb-web