Transforms browser navigation events into an async iterable.
npm i @dashkite/navigate
Bundle with your favorite bundler.
Install for document
:
import {navigate} from "@dashkite/navigate"
do ->
for await event from navigate document
console.log "Navigated to #{window.location.href}"
Or use within any Web Components that will need to handle navigation events. Just pass the document fragment to navigate
.
Adds an event listener for link click
events and determines whether they need to be routed internally or bubbled up to the browser. Produces events for each internal navigation.