Malli schemas for state machine data structures. Available on both JVM and ClojureScript via reader conditionals — Malli requires :clj for fn? predicates, so those are guarded.
Malli schemas for state machine data structures. Available on both JVM and ClojureScript via reader conditionals — Malli requires :clj for fn? predicates, so those are guarded.
An invoke turns its :src into an event for the state that holds it:
[:on-done result], or [:on-error ex-data] when :src throws an ex-info.
transition runs it when a step enters the state, and steps again with that
event, handled from the invoke's :on-done / :on-error like any other event.
An invoke turns its :src into an event for the state that holds it: [:on-done result], or [:on-error ex-data] when :src throws an ex-info. `transition` runs it when a step enters the state, and steps again with that event, handled from the invoke's :on-done / :on-error like any other event.
Used by the steps: where the state lives in the ctx, state paths and nodes, choosing among options, running an action.
Used by the steps: where the state lives in the ctx, state paths and nodes, choosing among options, running an action.
One transition (a microstep), pure: from the current state, the handler for
the event, its action, its target. Whether the state it entered has an invoke
to run is transition's business.
One transition (a microstep), pure: from the current state, the handler for the event, its action, its target. Whether the state it entered has an invoke to run is `transition`'s business.
Declarative tests for hierarchical state machines: expectations map, ordered trace of action/invoke labels. Invoke :src is not run; each id uses :invoke-returns if present, else {}. Returns :ok or failure maps for RCF.
Declarative tests for hierarchical state machines: expectations map, ordered trace
of action/invoke labels. Invoke :src is not run; each id uses :invoke-returns if present,
else {}. Returns :ok or failure maps for RCF.transition (a macrostep): one step for the event sent; when a step enters a
state with an :invoke, its :src runs here — the only side effect — and the event
it raises is the next step, until a step enters no invoking state. The machine
semantics end to end are in test/…/transition_test.cljc.
`transition` (a macrostep): one step for the event sent; when a step enters a state with an :invoke, its :src runs here — the only side effect — and the event it raises is the next step, until a step enters no invoking state. The machine semantics end to end are in test/…/transition_test.cljc.
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 |