htmx-extensions
htmx-extensions copied to clipboard
`hx-trigger="sse:<eventName>"` triggering twice in [email protected]
The endpoint /component/weather-form/ is triggered twice when receiving the end event.
I am currently using [email protected] and [email protected]
<div hx-ext="sse" sse-close="end" sse-connect="/weather/">
<div sse-swap="message"></div>
<div hx-trigger="sse:end" hx-get="/component/weather-form/" hx-swap="afterbegin" hx-target="#form"></div>
</div>
After further investigation, I found that the onEvent function in the extension is triggered both by elements having sse-connect and hx-trigger="sse:*". Consequently, registerSSE is being triggered twice.