https://htmx.org logo
Do you see those `console.log`s twice? If you do 2...
# htmx-general
l
Do you see those `console.log`s twice? If you do 2 navigations, does it happen 3 times? It sounds like it may be registering that on each navigation. I'm not aware of a way to count event listeners, and MDN's event reference didn't show me anything either. (the most useful one is linked below) You may want to define a global variable that you flip from false to true when you register the listener; since JS isn't multi-threaded, this should be a fine way to ensure that you don't register it multiple times. https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener