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>]
[:io <fn>]
[:after <ms> <event>]
[:subscribe <topic> <event>]
[:unsubscribe] | [:unsubscribe <topic>]
[: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>]
[:io <fn>]
[:after <ms> <event>]
[:subscribe <topic> <event>]
[:unsubscribe] | [:unsubscribe <topic>]
[: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.
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.
(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.
(io thunk)Call (thunk) off-thread, fire-and-forget.
Call `(thunk)` off-thread, fire-and-forget.
(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.
(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 |