htmx/www/attributes/kt-sse-src.md
2020-05-10 08:45:28 -07:00

663 B

layout title
layout.njk </> kutty - kt-sse-src

kt-sse-src

The kt-sse-src attribute establishes a Server Sent Event EventSource, allowing children of the element to register for server sent event triggers.

  <div kt-sse-src="/event_stream">
    <div kt-get="/chatroom" kt-trigger="sse:chatter">
      ...
    </div>
  </div>

This example establishes an SSE connection to the event_stream end point which then triggers a GET to the /chatroom url whenever the chatter event is seen.

Notes

  • kt-sse-src is not inherited