Tiny href click handler library.
var nanohref = require('nanohref')
nanohref(function (location) {
console.log('new location is', location.pathname)
})
// Create DOM node
var el = document.createElement('a')
el.setAttribute('href', '/my-link')
el.innerText = 'Click me'
document.body.appendChild(el)
// Trigger click
el.click()
// => "new location is /my-link"
Create a new anchor click handler. The second argument is for the root node,
which defaults to window.document
. If the data-no-routing
attribute is set,
Nanohref will not handle the link. This is useful to link to resources outside
the application.