git ssb

1+

dinoworm ๐Ÿ› / catstack



Tree: 98239f54c2e6218df2f0366082b40c6d256b1635

Files: 98239f54c2e6218df2f0366082b40c6d256b1635 / browser.js

1072 bytesRaw
1const pull = require('pull-stream')
2const combine = require('depject')
3const { entry } = require('inu')
4const { update } = require('yo-yo')
5const start = require('inu-engine')
6
7const configModule = require('./config')
8const appModules = require('./lib/app')
9const coreModules = require('./modules')
10
11// TODO this should be a depject module,
12// but first need to refactor this inu
13// code to work as such, using something
14// like: https://github.com/depject/depject/issues/26
15
16module.exports = startBrowser
17
18function startBrowser () {
19 const sockets = combine(
20 configModule,
21 appModules(),
22 coreModules
23 )
24
25 const cssRender = sockets.css.render[0]
26 const styles = document.createElement('style')
27 document.head.appendChild(styles)
28 console.log('sockets', sockets)
29 cssRender(styles)
30
31 const store = entry(sockets)
32 const { views, dispatch } = start(store)
33 // HACK inject dispatch
34 sockets.inu.dispatch.push(dispatch)
35 const main = document.createElement('div')
36 document.body.appendChild(main)
37 pull(views(), pull.drain(update.bind(null, main)))
38}
39

Built with git-ssb-web