Liking cljdoc? Tell your friends :D

taia.ds.datastar.adapters.handlers.response


->htmlclj

(->html hiccup)
source

component-responses?clj

(component-responses? html)

Returns true if the component returned a list of effects rather than plain hiccup. Effects are a seq of vectors whose first element is a keyword: [[:effect-name ...] ...].

Returns true if the component returned a list of effects rather than plain hiccup.
Effects are a seq of vectors whose first element is a keyword: [[:effect-name ...] ...].
sourceraw docstring

error-responseclj

(error-response e component-name component-id event-name controller-name)

The 400 a component event answers with when a step threw (or timed out): a plain-text diagnostic naming the component, instance, event and controller.

The 400 a component event answers with when a step threw (or timed out):
a plain-text diagnostic naming the component, instance, event and
controller.
sourceraw docstring

has-patch-effects?clj

(has-patch-effects? html)

Returns true if the effects list contains at least one :patch, :patch-signals, or :execute-script effect.

Returns true if the effects list contains at least one :patch, :patch-signals, or :execute-script effect.
sourceraw docstring

render-responseclj

(render-response {:keys [html request]})

Final pipeline step: converts the component result to a Ring response.

  • Effects with :patch/:patch-signals → one-shot SSE (multiple DOM/signal patches)
  • Effects without :patch → empty HTML body (no-op)
  • Plain hiccup → rendered as HTML
Final pipeline step: converts the component result to a Ring response.
- Effects with :patch/:patch-signals → one-shot SSE (multiple DOM/signal patches)
- Effects without :patch             → empty HTML body (no-op)
- Plain hiccup                       → rendered as HTML
sourceraw docstring

send-effect!clj

(send-effect! sse-gen [effect-type payload opts])

Dispatches a single effect to the SSE generator. Handles :patch (DOM elements), :patch-signals (client signals), and :execute-script (run JS on client).

Dispatches a single effect to the SSE generator.
Handles :patch (DOM elements), :patch-signals (client signals),
and :execute-script (run JS on client).
sourceraw docstring

send-responsesclj

(send-responses req effects)

Sends all [:patch ...], [:patch-signals ...], and [:execute-script ...] effects from effects as a one-shot SSE response. Multiple events are emitted before the SSE connection is closed. Other effects (e.g. :broadcast-elements!) are ignored here — they are handled separately by broadcast-to-connections.

Sends all [:patch ...], [:patch-signals ...], and [:execute-script ...] effects
from `effects` as a one-shot SSE response. Multiple events are emitted before
the SSE connection is closed. Other effects (e.g. :broadcast-elements!) are
ignored here — they are handled separately by broadcast-to-connections.
sourceraw docstring

to-d*clj

(to-d* m)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close