package dream-htmx

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Dream_htmxSource

This module provides utilities to deal with Htmx requests/responses.

Requests

Sourceval is_htmx : Dream.request -> bool

is_htmx request will be true if the request has been issued by htmx.

Sourceval trigger : Dream.request -> string option

trigger request gives the id of the element which trigger the request if available.

Sourceval trigger_name : Dream.request -> string option

trigger_name request gives the name of the element which trigger the request if available.

Sourceval target : Dream.request -> string option

target request gives the id of the target element if available.

Sourceval prompt : Dream.request -> string option

prompt request is the value entered by the user when prompted via hx-prompt.

Responses

Sourceval push : string -> Dream.response -> unit

push url pushes a new URL into the browser’s address bar.

Sourceval redirect : string -> Dream.response -> unit

redirect url triggers a client-side redirect to a new location.

Sourceval set_location : string -> Dream.response -> unit

set_location url triggers a client-side redirect to a new location that acts as a swap.

Sourceval refresh : Dream.response -> unit

refresh triggers a client side full refresh of the page.

Sourceval set_trigger : string -> Dream.response -> unit

set_trigger event triggers a client side event.

Sourceval set_trigger_after_swap : string -> Dream.response -> unit

set_trigger_after_swap event triggers a client side event after the swap step.

Sourceval set_trigger_after_settle : string -> Dream.response -> unit

set_trigger_after_settle event triggers a client side event after the settle step.