git ssb

2+

mixmix / ticktack



Tree: fb0788760b2ce15437b50ead1e804b650cc19077

Files: fb0788760b2ce15437b50ead1e804b650cc19077 / 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