Closed gnituy18 closed 2 weeks ago
The endpoint /component/weather-form/ is triggered twice when receiving the end event.
/component/weather-form/
end
I am currently using htmx@2.0.0-beta3 and sse@2.1.0
htmx@2.0.0-beta3
sse@2.1.0
<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.
sse-connect
hx-trigger="sse:*"
Closing as it was resolvd in #18
The endpoint
/component/weather-form/
is triggered twice when receiving theend
event.I am currently using
htmx@2.0.0-beta3
andsse@2.1.0
After further investigation, I found that the onEvent function in the extension is triggered both by elements having
sse-connect
andhx-trigger="sse:*"
. Consequently, registerSSE is being triggered twice.