denoland / fresh

The next-gen web framework.
https://fresh.deno.dev
MIT License
12.54k stars 648 forks source link

Add a way to listen to partial events #2234

Open marvinhagemeister opened 10 months ago

marvinhagemeister commented 10 months ago

Discussed in https://github.com/denoland/fresh/discussions/2233

Originally posted by **thoratica** January 10, 2024 Hi, I'm using Fresh with Partials enabled. I need a way to detect url changes when using Partials, but couldn't find a right one. I tried listening for popstate events, added anchors of each pages and used MutationObserver to observe the DOM changes and check the data-current and data-ancestor, etc.