The Datastar-expression boundary type.
RawExpr wraps a finished Datastar/JS expression string (e.g. the
@post(...) an h/action produces). It exists so the same value can be
used in two contexts without the caller choosing between them:
h/expr — it contributes its raw JS, not a quoted JS
string literal (via the DatastarExpr protocol).Signals implement DatastarExpr too (yielding their $ref), so both ride
the same splice path; anything that does not implement it falls back to a
JavaScript literal.
The Datastar-expression boundary type. `RawExpr` wraps a finished Datastar/JS expression string (e.g. the `@post(...)` an `h/action` produces). It exists so the same value can be used in two contexts without the caller choosing between them: - as a hiccup attribute value — it renders like the string it wraps, escaped for the HTML attribute context (via Chassis); - spliced inside `h/expr` — it contributes its raw JS, not a quoted JS string literal (via the `DatastarExpr` protocol). Signals implement `DatastarExpr` too (yielding their `$ref`), so both ride the same splice path; anything that does not implement it falls back to a JavaScript literal.
(datastar-expr? x)True when x renders as a raw Datastar expression (implements DatastarExpr).
True when x renders as a raw Datastar expression (implements DatastarExpr).
(-datastar-js x)The raw Datastar/JS expression source for x, embeddable verbatim in a compiled expression.
The raw Datastar/JS expression source for x, embeddable verbatim in a compiled expression.
(raw-expr js)Wrap a finished Datastar expression string as a RawExpr. Idempotent.
Wrap a finished Datastar expression string as a RawExpr. Idempotent.
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 |