Using the SSE extension I was a bit confused about how to append new messages at the end of a list, as by default the latest message is swapped with a newer one, searched on Discord before occurring to me I could use hx-swap.
https://discord.com/channels/725789699527933952/1171616558330679306
Maybe worth mentioning in the docs?
Got this docs update proposal if I can do a PR (saw it must be pre-approved via issues) flaviocopes@3480c1c
Swap Strategy
You can use any hx-swap strategy for the incoming messages, for example to append a message at the end of a list, add hx-swap='beforeend':
<div
hx-ext='sse'
sse-connect='/event-source'
sse-swap='message'
hx-swap='beforeend'>
</div>
Using the SSE extension I was a bit confused about how to append new messages at the end of a list, as by default the latest message is swapped with a newer one, searched on Discord before occurring to me I could use hx-swap.
https://discord.com/channels/725789699527933952/1171616558330679306
Maybe worth mentioning in the docs?
Got this docs update proposal if I can do a PR (saw it must be pre-approved via issues) flaviocopes@3480c1c
Swap Strategy
You can use any
hx-swapstrategy for the incoming messages, for example to append a message at the end of a list, addhx-swap='beforeend':