git ssb

2+

mixmix / ticktack



Tree: 4a58e38afe8d7cd5659d286607457aeb91ee7638

Files: 4a58e38afe8d7cd5659d286607457aeb91ee7638 / 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