git ssb

2+

mixmix / ticktack



Tree: 0fcc1b759bd9738e215c6396ad40e686e7ba73c4

Files: 0fcc1b759bd9738e215c6396ad40e686e7ba73c4 / 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