Reusable interceptors for system operations.
All interceptors follow the re-frame context model: {:coeffects {:event [...] :db ...} :effects {...}}
Reusable interceptors for system operations.
- timing: Measures wall-clock duration, injects into effects
- journal: Records operation to IJournal after execution
- tool-check: Validates binary exists before shell exec
- result-lift: Converts raw handler return into Result-typed effect
All interceptors follow the re-frame context model:
{:coeffects {:event [...] :db ...} :effects {...}}After handler completes, dispatches a completion event if :emit is in effects. Enables event chaining: handler returns {:result ... :emit [:next-event data]}
After handler completes, dispatches a completion event if :emit is in effects.
Enables event chaining: handler returns {:result ... :emit [:next-event data]}Records the operation to IJournal after execution. Reads :journal-fn from coeffects (injected at init). Captures: event type, input, output, duration, success.
Records the operation to IJournal after execution. Reads :journal-fn from coeffects (injected at init). Captures: event type, input, output, duration, success.
Standard interceptor chain for system operations. Timing → Journal → Emit (applied in order).
Standard interceptor chain for system operations. Timing → Journal → Emit (applied in order).
Measures wall-clock duration of the handler phase. Injects :duration-ms into the effects map on :after.
Measures wall-clock duration of the handler phase. Injects :duration-ms into the effects map on :after.
(tool-check)(tool-check extract-bin-fn)Interceptor that verifies a binary exists before execution. If the binary is not found, short-circuits with an err Result containing install hints.
Usage: (reg-event-fx :shell/exec [(tool-check :cmd-extractor-fn)] handler)
The extract-fn receives the event and returns the binary name to check. Defaults to extracting from the first arg if it's a vector command.
Interceptor that verifies a binary exists before execution.
If the binary is not found, short-circuits with an err Result
containing install hints.
Usage:
(reg-event-fx :shell/exec
[(tool-check :cmd-extractor-fn)]
handler)
The extract-fn receives the event and returns the binary name to check.
Defaults to extracting from the first arg if it's a vector command.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 |