htmx v2-beta4 #12
|
@ -811,6 +811,12 @@ let attributes =
|
||||||
test "_hxWs succeeds" {
|
test "_hxWs succeeds" {
|
||||||
ul [ _hxWs "connect:/web-socket" ] [] |> shouldRender """<ul hx-ws="connect:/web-socket"></ul>"""
|
ul [ _hxWs "connect:/web-socket" ] [] |> shouldRender """<ul hx-ws="connect:/web-socket"></ul>"""
|
||||||
}
|
}
|
||||||
|
test "_sseSwap succeeds" {
|
||||||
|
ul [ _sseSwap "sseMessageName" ] [] |> shouldRender """<ul sse-swap="sseMessageName"></ul>"""
|
||||||
|
}
|
||||||
|
test "_sseConnect succeeds" {
|
||||||
|
div [ _sseConnect "/gps/sse" ] [] |> shouldRender """<div sse-connect="/gps/sse"></div>"""
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
/// Tests for the Script module
|
/// Tests for the Script module
|
||||||
|
|
|
@ -317,6 +317,7 @@ module HxVals =
|
||||||
/// Create values from a list of key/value pairs
|
/// Create values from a list of key/value pairs
|
||||||
let From = toJson
|
let From = toJson
|
||||||
|
|
||||||
|
|
||||||
/// Attributes and flags for htmx
|
/// Attributes and flags for htmx
|
||||||
[<AutoOpen>]
|
[<AutoOpen>]
|
||||||
module HtmxAttrs =
|
module HtmxAttrs =
|
||||||
|
@ -438,6 +439,12 @@ module HtmxAttrs =
|
||||||
/// Establishes a WebSocket or sends information to one
|
/// Establishes a WebSocket or sends information to one
|
||||||
let _hxWs = attr "hx-ws"
|
let _hxWs = attr "hx-ws"
|
||||||
|
|
||||||
|
/// The name of the message to swap into the DOM.
|
||||||
|
let _sseSwap = attr "sse-swap"
|
||||||
|
|
||||||
|
/// The URL of the SSE server.
|
||||||
|
let _sseConnect = attr "sse-connect"
|
||||||
|
|
||||||
|
|
||||||
/// Script tags to pull htmx into an web page
|
/// Script tags to pull htmx into an web page
|
||||||
module Script =
|
module Script =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user