git ssb

2+

mixmix / ticktack



Tree: f3a07a62ed183316f08c7c0cf24dcb767afd29b1

Files: f3a07a62ed183316f08c7c0cf24dcb767afd29b1 / app / sync / initialize / clickHandler.js

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

Built with git-ssb-web