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>]
[:history :replace|:push <url>]
[: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>]
    [:history :replace|:push <url>]
    [: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-errorclj

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

answer-error-valueclj

(answer-error-value eff)
source

answer-valueclj

(answer-value eff)
source

backclj

(back)

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 [_op _embed _resume-kw resume])
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

historyclj

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

history-modeclj

(history-mode eff)
source

history-urlclj

(history-url eff)
source

ioclj

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

io-thunkclj

(io-thunk eff)
source

keyed-children-pairsclj

(keyed-children-pairs eff)
source

keyed-children-slotclj

(keyed-children-slot 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

set-keyed-childrenclj

(set-keyed-children slot pairs)

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.

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

slot-call-embedclj

(slot-call-embed eff)
source

slot-call-resumeclj

(slot-call-resume [_op _slot _embed _resume-kw resume])
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