Liking cljdoc? Tell your friends :D

taia.ds.datastar.adapters.handlers.default-component-handler

Dynamic endpoint handler for component events. Handles routes like /:component/:component-id/:event.

The event runs through a component flow of its own (process-component-event: request → message → the process-event use case); the response shaping (render-response, error-response) lives in taia.ds.datastar.adapters.handlers.response. This namespace only owns the Ring handler entrypoint.

Dynamic endpoint handler for component events.
Handles routes like /:component/:component-id/:event.

The event runs through a component flow of its own
(`process-component-event`: request → message → the process-event use
case); the response
shaping (`render-response`, `error-response`) lives in
`taia.ds.datastar.adapters.handlers.response`. This namespace only owns the
Ring handler entrypoint.
raw docstring

default-handlerclj

(default-handler req)
(default-handler req respond raise)

Main handler for dynamic component events. Supports two route patterns:

  • /:component/:component-id/:event (backward compatible)
  • /:component/:component-id/:controller/:event (with optional controller)

Example: /ds/user-form/abc123/save

  • component: user-form
  • component-id: abc123
  • event: save

Example with controller: /ds/counter/c1/counter-controller/increment

  • component: counter
  • component-id: c1
  • controller: counter-controller
  • event: increment

Supports both synchronous (1-arity) and asynchronous (3-arity) handlers. Async version: [req respond raise]

Main handler for dynamic component events.
Supports two route patterns:
- /:component/:component-id/:event (backward compatible)
- /:component/:component-id/:controller/:event (with optional controller)

Example: /ds/user-form/abc123/save
- component: user-form
- component-id: abc123
- event: save

Example with controller: /ds/counter/c1/counter-controller/increment
- component: counter
- component-id: c1
- controller: counter-controller
- event: increment

Supports both synchronous (1-arity) and asynchronous (3-arity) handlers.
Async version: [req respond raise]
sourceraw docstring

process-component-eventclj

(process-component-event req
                         component-name
                         component-id
                         event-name
                         controller-name)

One event of a one-shot component, from its request: resolves the component (discovery), turns the request into the flow's message and runs the process-event use case. Returns {:event :initial-ctx :ctx :html …} — :html is hiccup or an effects list. Throws what a step threw, or on timeout.

One event of a one-shot component, from its request: resolves the component
(discovery), turns the request into the flow's message and runs the
process-event use case. Returns {:event :initial-ctx :ctx :html …} — `:html`
is hiccup or an effects list. Throws what a step threw, or on timeout.
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