I've been using an IntersectionObserver to update the url of my SPA while the user scrolls down the page like so:
const sections = document.querySelectorAll('section')
const options = {
threshold: 0.5
}
const observer = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
router.push('#' + entry.target.id)
}
})
}, options)
sections.forEach(section => {
observer.observe(section)
})
but how do I do this in Inertia.js since it doesn't have the router.push method? I'm using Inertia with a Vue 3 frontend.
