Constructors and accessors for the effect vocabulary the kernel folds.
Effects on the wire are plain vectors keyed by an op tag:
[:call <embed> :resume <k>]
[:call-in-slot <slot> <embed> :resume <k>]
[:answer <value>]
[:replace <embed>]
[:patch <hiccup>]
[:patch-signals <map>]
[:execute-script <js>]
[:history :replace|:push <url>]
[:io <fn>]
[:after <ms> <event>]
[:subscribe <topic> <event>]
[:unsubscribe] | [:unsubscribe <topic>]
[:dispatch-to <iid> <route-event>]
[:back]
[:end <value>]
This namespace deliberately does NOT change that wire shape. It only
gives callers — handlers, the kernel's step methods, tests — named
helpers so the data contract lives in one file instead of being spread
across pattern-matching destructure forms.
Constructors are named after the op; accessors are named
<op>-<role> (e.g. call-embed, after-delay). Effects that
the kernel materially treats as continuations (call/answer/etc.) and
those that are pure side-effects (io/after/subscribe/etc.) live side
by side here because they share one folder.
Constructors and accessors for the effect vocabulary the kernel folds.
Effects on the wire are plain vectors keyed by an op tag:
[:call <embed> :resume <k>]
[:call-in-slot <slot> <embed> :resume <k>]
[:answer <value>]
[:replace <embed>]
[:patch <hiccup>]
[:patch-signals <map>]
[:execute-script <js>]
[:history :replace|:push <url>]
[:io <fn>]
[:after <ms> <event>]
[:subscribe <topic> <event>]
[:unsubscribe] | [:unsubscribe <topic>]
[:dispatch-to <iid> <route-event>]
[:back]
[:end <value>]
This namespace deliberately does NOT change that wire shape. It only
gives callers — handlers, the kernel's `step` methods, tests — named
helpers so the data contract lives in one file instead of being spread
across pattern-matching destructure forms.
Constructors are named after the op; accessors are named
`<op>-<role>` (e.g. [[call-embed]], [[after-delay]]). Effects that
the kernel materially treats as continuations (call/answer/etc.) and
those that are pure side-effects (io/after/subscribe/etc.) live side
by side here because they share one folder.Instance id whose handler/lifecycle hook emitted the effects currently
being folded. Stack calls historically used the top frame, but
embedded children can also handle events; slot-local effects need the
actual emitting instance. Bound by the kernel/lifecycle around any
call to run-effects.
Instance id whose handler/lifecycle hook emitted the effects currently being folded. Stack calls historically used the top frame, but embedded children can also handle events; slot-local effects need the actual emitting instance. Bound by the kernel/lifecycle around any call to `run-effects`.
(after delay-ms route-event)Schedule route-event for the current instance after delay-ms.
Schedule `route-event` for the current instance after `delay-ms`.
(answer value)Pop this frame; deliver value to the parent under its resume key.
Pop this frame; deliver `value` to the parent under its resume key.
(answer-error ex)Pop this frame and route the exception through the parent's
:on-error-<key> resume handler instead of :on-<key>.
If the parent declared only :on-<key>, the kernel falls back to it
with a wrapped value [:error ex] and logs a one-time deprecation
warning per component. If neither is declared, the parent surfaces a
default error banner just like an intra-component throw.
Pop this frame and route the exception through the parent's `:on-error-<key>` resume handler instead of `:on-<key>`. If the parent declared only `:on-<key>`, the kernel falls back to it with a wrapped value `[:error ex]` and logs a one-time deprecation warning per component. If neither is declared, the parent surfaces a default error banner just like an intra-component throw.
(back)Restore the previous conversation snapshot from :conv/history.
Restore the previous conversation snapshot from `:conv/history`.
(call embed)(call embed resume-key)Push a child onto the stack. On :answer, the parent's resume-key
function is invoked with the answered value.
Push a child onto the stack. On `:answer`, the parent's `resume-key` function is invoked with the answered value.
(call-in-slot slot embed)(call-in-slot slot embed resume-key)Temporarily swap an embedded slot's child; the new child answers back to the parent without taking over the page.
Temporarily swap an embedded slot's child; the new child answers back to the parent without taking over the page.
(dispatch-to target-iid route-event)Asynchronously deliver route-event to the live instance named by
target-iid, exactly as if it had been POSTed from a button wired
with (s/on-target target-iid :click :as route-event).
route-event is the same shape as (s/on … :as …) accepts: either
a keyword (:open) or a vector [event & payload] ([:open id]).
Pure kernels leave this effect inert; the runtime fires the
dispatch on a background thread so the current handler completes
first and re-entrancy through the per-cid lock is impossible.
Asynchronously deliver `route-event` to the live instance named by `target-iid`, exactly as if it had been POSTed from a button wired with `(s/on-target target-iid :click :as route-event)`. `route-event` is the same shape as `(s/on … :as …)` accepts: either a keyword (`:open`) or a vector `[event & payload]` (`[:open id]`). Pure kernels leave this effect inert; the runtime fires the dispatch on a background thread so the current handler completes first and re-entrancy through the per-cid lock is impossible.
(end value)Terminate the conversation with a final value.
Terminate the conversation with a final value.
(execute-script js)Run literal JS in the browser.
Run literal JS in the browser.
(history mode url)Sync the browser URL without a page reload.
Two modes:
(history :replace url) ; → [:history :replace url]
(history :push url) ; → [:history :push url]
:replace calls history.replaceState; :push calls history.pushState.
URL may be an absolute path, a relative path, or a full URL string.
Use :replace when a mutation updates the "current" logical page (e.g.
search filter change) and :push when the user navigates to a new page
(e.g. opening a note, advancing a wizard step).
URL parsing on first load is not in scope — read ?q= from the GET
request and pass it as init-args to mint-conversation!.
Sync the browser URL without a page reload.
Two modes:
(history :replace url) ; → [:history :replace url]
(history :push url) ; → [:history :push url]
`:replace` calls `history.replaceState`; `:push` calls `history.pushState`.
URL may be an absolute path, a relative path, or a full URL string.
Use `:replace` when a mutation updates the "current" logical page (e.g.
search filter change) and `:push` when the user navigates to a new page
(e.g. opening a note, advancing a wizard step).
URL parsing on first load is not in scope — read `?q=` from the GET
request and pass it as init-args to `mint-conversation!`.(io thunk)Ask the active runtime to call (thunk) off-thread, fire-and-forget.
Pure kernel folds leave this effect inert unless a runtime hook is
bound.
Ask the active runtime to call `(thunk)` off-thread, fire-and-forget. Pure kernel folds leave this effect inert unless a runtime hook is bound.
(op eff)Return the op keyword of an effect vector.
Return the op keyword of an effect vector.
(op? op-kw eff)True when eff is an effect with op op-kw.
True when `eff` is an effect with op `op-kw`.
(patch hiccup)Emit an extra DOM patch without changing the stack.
Emit an extra DOM patch without changing the stack.
(patch-signals m)Push a Datastar signal patch.
Push a Datastar signal patch.
(replace embed)Pop this frame and push another in its place (Seaside become:).
The replacement inherits the original parent linkage and resume key.
Pop this frame and push another in its place (Seaside `become:`). The replacement inherits the original parent linkage and resume key.
(set-keyed-children slot pairs)(set-keyed-children slot pairs opts)Reconcile the keyed-child set of slot to the ordered pairs
[[stable-key embed-spec] ...]. See dev.zeko.stube.keyed/reconcile!
for the diff semantics.
opts (optional) may contain:
:rerender-parent? — when truthy, the kernel re-renders the
parent frame after the keyed-children diff has applied. Use
this when the parent's hiccup outside the keyed-children
container depends on the just-reconciled state ((s/keyed-children self slot) reads stale state during the handler because the
update lands during the effect fold, not before it).Reconcile the keyed-child set of `slot` to the ordered `pairs` `[[stable-key embed-spec] ...]`. See `dev.zeko.stube.keyed/reconcile!` for the diff semantics. `opts` (optional) may contain: * `:rerender-parent?` — when truthy, the kernel re-renders the parent frame after the keyed-children diff has applied. Use this when the parent's hiccup outside the keyed-children container depends on the just-reconciled state (`(s/keyed-children self slot)` reads stale state during the handler because the update lands during the effect fold, not before it).
(subscribe topic route-event)Subscribe the current instance to topic. Published messages arrive
as route-event.
Subscribe the current instance to `topic`. Published messages arrive as `route-event`.
(unsubscribe)(unsubscribe topic)Remove the current instance's topic subscription(s).
Remove the current instance's topic subscription(s).
(with-origin iid & body)Bind *effect-iid* to iid while running body. Use whenever
you fold effects whose origin is not the current top frame.
Bind [[*effect-iid*]] to `iid` while running `body`. Use whenever you fold effects whose origin is not the current top frame.
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 |