Skip to main content

htmx_flash

Function htmx_flash 

Source
pub async fn htmx_flash(req: Request, next: Next) -> Response
Expand description

Append pending flash messages to in-place htmx responses as an OOB swap.

Mounted between request_ctx and MessagesManagerLayer. On a full-page render the layout has already drained the messages by the time this runs, so it finds none and returns the response untouched. On an in-place htmx swap (htmx request, no HX-Redirect/HX-Location) it drains the pending messages and appends flash_oob.html to the body, which htmx applies out-of-band.