Intercept click on <a href="">
local links, usefull for single page app.
The code is extracted from Sheet-router/href.js and catch-links.
All credits are due to Yoshua Wuyts and James Halliday
The goal of this module is to be self-contained and avoid the url
module dependency.
The signature is similar to catch-links.
const catchLinks = require('a-catcher');
catchLinks(window, function (href) {
console.log(href);
});
var catchLinks = require('a-catcher')
Fire cb(href)
whenever an anchor tag descendant of element
with an in-server
url is clicked.
With npm do:
npm install a-catcher