git ssb

2+

mixmix / ticktack



Tree: 1ff52dc468c28cdb7ae8aacd80a6a310a42e91b3

Files: 1ff52dc468c28cdb7ae8aacd80a6a310a42e91b3 / 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