git ssb

2+

mixmix / ticktack



Tree: 52acefb26cfdc545a5bef98c649d3cfbec4ac257

Files: 52acefb26cfdc545a5bef98c649d3cfbec4ac257 / app / sync / initialize / clickHandler.js

502 bytesRaw
1const nest = require('depnest')
2
3exports.gives = nest('app.sync.initialize')
4
5exports.needs = nest({
6 'app.async.catchLinkClick': 'first',
7 'history.sync.push': 'first',
8})
9
10exports.create = (api) => {
11 return nest({
12 'app.sync.initialize': function initializeClickHandling () {
13 const target = document.body
14
15 api.app.async.catchLinkClick(target, (link, { isExternal }) => {
16 if (isExternal) return openExternal(link)
17
18 api.history.sync.push(link)
19 })
20 }
21 })
22}
23
24

Built with git-ssb-web