git ssb

2+

mixmix / ticktack



Tree: 20d42aa4579ccf514dcea6d0c660fbf3d715a74c

Files: 20d42aa4579ccf514dcea6d0c660fbf3d715a74c / 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