git ssb

2+

mixmix / ticktack



Tree: ca60633113df0b41f3bab3e4319dcd13a9c9555e

Files: ca60633113df0b41f3bab3e4319dcd13a9c9555e / app / sync / goTo.js

522 bytesRaw
1const nest = require('depnest')
2
3exports.gives = nest('app.sync.goTo')
4
5exports.needs = nest({
6 'router.sync.router': 'first'
7})
8
9exports.create = (api) => {
10 return nest('app.sync.goTo', goTo)
11
12 function goTo (location) {
13 console.log('goTo', location)
14 const newView = api.router.sync.router(location)
15
16 // TODO (mix) : change once history in place
17 const oldView = document.body.firstChild
18 oldView
19 ? document.body.replaceChild(newView, oldView)
20 : document.body.appendChild(newView)
21 }
22}
23

Built with git-ssb-web