Liking cljdoc? Tell your friends :D

dev.arkaitz.web-base.htmx

The named places where web-base touches htmx (SPEC §9). Every HX- literal in the base lives in this file: the request classifier that decides fragment or page, and the redirect response the gate answers with. The error renderer is the third place and it calls partial-request? rather than reading headers.

Verified against htmx 4.0.0: HX-Request is sent on every htmx request, and HX-Request-Type says full when the swap targets the whole document — a history restore, a body-targeted swap — and partial otherwise. Deciding on HX-Request alone would hand a bare fragment to the back button.

The named places where web-base touches htmx (SPEC §9). Every `HX-` literal in
the base lives in this file: the request classifier that decides fragment or
page, and the redirect response the gate answers with. The error renderer is
the third place and it calls `partial-request?` rather than reading headers.

Verified against htmx 4.0.0: `HX-Request` is sent on every htmx request, and
`HX-Request-Type` says `full` when the swap targets the whole document — a
history restore, a body-targeted swap — and `partial` otherwise. Deciding on
`HX-Request` alone would hand a bare fragment to the back button.
raw docstring

fragment-headersclj

The request headers htmx 4 sends for a swap, as Ring delivers them: what a host's test sends to stand in for one. partial-request? answers true.

The request headers htmx 4 sends for a swap, as Ring delivers them: what
a host's test sends to stand in for one. `partial-request?` answers true.
sourceraw docstring

partial-request?clj

(partial-request? request)

True when htmx asked for a fragment rather than a whole document. Ring lowercases request header names.

True when htmx asked for a fragment rather than a whole document. Ring
lowercases request header names.
sourceraw docstring

redirectclj

(redirect location)

A response that makes htmx navigate the whole window to location. A 302 would be followed by htmx and its target swapped with the login page; and HX-Location would do the same through an AJAX navigation. Only HX-Redirect leaves the fragment's target alone.

A response that makes htmx navigate the whole window to `location`. A `302`
would be followed by htmx and its target swapped with the login page; and
`HX-Location` would do the same through an AJAX navigation. Only
`HX-Redirect` leaves the fragment's target alone.
sourceraw docstring

varyclj

Value of the Vary header for any response whose shape depends on the request being an htmx fragment or a page, so a shared cache never serves a fragment to a navigation.

Value of the `Vary` header for any response whose shape depends on the
request being an htmx fragment or a page, so a shared cache never serves a
fragment to a navigation.
sourceraw docstring

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