htmx-lucid-0.2.0.1: Use htmx with lucid
Safe HaskellSafe-Inferred
LanguageHaskell2010

Htmx.Lucid.Extension.ServerSentEvents

Description

The Server Sent Events extension connects to an EventSource directly from HTML. It manages the connections to your web server, listens for server events, and then swaps their contents into your htmx webpage in real-time. https://github.com/bigskysoftware/htmx-extensions/blob/main/src/sse/README.md

Synopsis

Documentation

data SseEventKind Source #

A stronger type for the different kinds of events permitted by sseSwap_

Constructors

Named Text 
UnNamed 

sseSwap_ :: SseEventKind -> Attributes Source #

https://github.com/bigskysoftware/htmx-extensions/tree/main/src/sse#receiving-named-events event name to listen for in an SSE message, the contents of the message will be swapped into the tag this attribute is on. For named events the message structure is as follows:

event: EventName
data: divContent to swap into your HTML page./divsseSwap_ :: Text -> Attributes

For unnamed events the message structure should look like this:

data: divContent to swap into your HTML page./divsseSwap_ :: Text -> Attributes