-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Currently, users must manually add a click handler to their links and then call follow
to trigger a new fetch.
It would be a better DX if this happened automagically with a simple way to opt out of that behavior.
To automatically listen for link clicks, the bootstrap
function should add an event click listener to the div#app
element.
The listener should then:
- Check the event target element to determine if the click target is an anchor element, if not, do nothing
- Check whether the anchor's
href
is a relative URL (e.g../
or/
), of not, do nothing - Check whether the anchor has a
type
attribute, if so, do nothing.
If all checks pass, the handler should stop event propogation and call the client's follow
function.
Once this PR is ready, the next step should be to prepare a draft PR against the https://github.com/Applura/intro repo, removing any individual link handlers in favor of the new bootstrap functionality in this PR. The purpose of that draft will be to test and validate the approach here.