Utilities providing a test SSEGenerator and a mock ->sse-response
function.
Utilities providing a test SSEGenerator and a mock `->sse-response` function.
(->sse-gen & _)Returns a SSEGenerator whose
starfederation.datastar.clojure.protocols/send-event! implementation
is a stub that returns the event string instead of sending it.
Returns a SSEGenerator whose [[starfederation.datastar.clojure.protocols/send-event!]] implementation is a stub that returns the event string instead of sending it.
(->sse-response req {on-open ac/on-open :keys [status headers]})Fake a sse-response, it returns the ring response map with
the :status, :headers and :body keys sent.
The events sent with sse-gen during the on-open callback are recorded in a
vector stored in an atom. This atom is provided as the value for the
response's :body.
Fake a sse-response, it returns the ring response map with the `:status`, `:headers` and `:body` keys sent. The events sent with sse-gen during the `on-open` callback are recorded in a vector stored in an atom. This atom is provided as the value for the response's `:body`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |