Liking cljdoc? Tell your friends :D

dev.zeko.stube.effects

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.
raw docstring

*effect-iid*clj

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`.
sourceraw docstring

afterclj

(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`.
sourceraw docstring

after-delayclj

(after-delay eff)
source

after-eventclj

(after-event eff)
source

answerclj

(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.
sourceraw docstring

answer-valueclj

(answer-value eff)
source

backclj

Restore the previous conversation snapshot from :conv/history.

Restore the previous conversation snapshot from `:conv/history`.
sourceraw docstring

callclj

(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.
sourceraw docstring

call-embedclj

(call-embed eff)
source

call-in-slotclj

(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.
sourceraw docstring

call-resumeclj

(call-resume eff)
source

endclj

(end value)

Terminate the conversation with a final value.

Terminate the conversation with a final value.
sourceraw docstring

end-valueclj

(end-value eff)
source

execute-scriptclj

(execute-script js)

Run literal JS in the browser.

Run literal JS in the browser.
sourceraw docstring

ioclj

(io thunk)

Call (thunk) off-thread, fire-and-forget.

Call `(thunk)` off-thread, fire-and-forget.
sourceraw docstring

io-thunkclj

(io-thunk eff)
source

opclj

(op eff)

Return the op keyword of an effect vector.

Return the op keyword of an effect vector.
sourceraw docstring

op?clj

(op? op-kw eff)

True when eff is an effect with op op-kw.

True when `eff` is an effect with op `op-kw`.
sourceraw docstring

patchclj

(patch hiccup)

Emit an extra DOM patch without changing the stack.

Emit an extra DOM patch without changing the stack.
sourceraw docstring

patch-hiccupclj

(patch-hiccup eff)
source

patch-signalsclj

(patch-signals m)

Push a Datastar signal patch.

Push a Datastar signal patch.
sourceraw docstring

patch-signals-mapclj

(patch-signals-map eff)
source

replaceclj

(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.
sourceraw docstring

replace-embedclj

(replace-embed eff)
source

script-sourceclj

(script-source eff)
source

slot-call-embedclj

(slot-call-embed eff)
source

slot-call-resumeclj

(slot-call-resume eff)
source

slot-call-slotclj

(slot-call-slot eff)
source

subscribeclj

(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`.
sourceraw docstring

subscribe-eventclj

(subscribe-event eff)
source

subscribe-topicclj

(subscribe-topic eff)
source

unsubscribeclj

(unsubscribe)
(unsubscribe topic)

Remove the current instance's topic subscription(s).

Remove the current instance's topic subscription(s).
sourceraw docstring

unsubscribe-topicclj

(unsubscribe-topic eff)
source

with-origincljmacro

(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.
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