forked from fiatjaf/coisas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
40 lines (33 loc) · 989 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// buble needs this:
window.xtend = require('xtend')
// export all these libraries so remote coisas.js can use them
// it costs nothing to do so.
window.load = (url, cb) => {
if (cb) {
return require('fetch-js')(url, cb)
}
return new Promise((resolve, reject) =>
require('fetch-js')(url, err => {
if (err) return reject(err)
resolve()
})
)
}
window.React = require('react')
window.ReactDOM = require('react-dom')
window.h = require('react-hyperscript')
window.matter = require('gray-matter')
// ~
require('./preferences')
const React = require('react')
const render = require('react-dom').render
const Main = require('./Main')
render(
React.createElement(Main),
document.getElementById('root')
)
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/service-worker.js', {scope: '/'})
.then(reg => console.log('service worker registered.', reg.scope))
.catch(e => console.log('failed to register service worker.', e))
}