hx-sse allows you to work with Server Sent Event
EventSources directly from HTML. The value of the attribute is of the following form:
connect <url>- A URL to establish an
When a connection for server sent events has been established, child elements can listen for these events by using
sse:<event_name>. This, when combined with an
or similar will trigger the element to make a request.
Here is an example:
<div hx-sse="connect /event_stream"> <div hx-get="/chatroom" hx-trigger="sse:chatter"> ... </div> </div>
This example establishes an SSE connection to the
event_stream end point which then triggers
GET to the
/chatroom url whenever the
chatter event is seen.
hx-sseis not inherited