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.
(assoc-action-result {:keys [opts handler bare-ctx event] :as step})Adds :new-ctx: the handler's action applied to :bare-ctx (no action → as is).
Adds :new-ctx: the handler's action applied to :bare-ctx (no action → as is).
(assoc-current-state {:keys [ctx opts] :as step})Adds :path (the current state as a path) and :bare-ctx (the ctx actions and conds see: without the state key and :invoke).
Adds :path (the current state as a path) and :bare-ctx (the ctx actions and conds see: without the state key and :invoke).
(assoc-handler {[event-name] :event :as step})Adds :handler — for an invoke's :on-done / :on-error from the current state's :invoke, for any other event from the machine's / state's :on.
Adds :handler — for an invoke's :on-done / :on-error from the current state's :invoke, for any other event from the machine's / state's :on.
The events an invoke raises; reserved: they are answered from the current state's :invoke, never from an :on.
The events an invoke raises; reserved: they are answered from the current state's :invoke, never from an :on.
(move-to-target {:keys [ctx opts path handler new-ctx] :as step})Sets :ctx to where the handler leads and :entered to the state moved into — nil when the handler has no target (it stays) or there is no handler (the ctx is left as it was).
Sets :ctx to where the handler leads and :entered to the state moved into — nil when the handler has no target (it stays) or there is no handler (the ctx is left as it was).
(step step-map)One transition: {:machine :ctx :event [name params] :opts} → {:ctx new-ctx :entered state-or-nil}. Pure: no :src runs here.
One transition: {:machine :ctx :event [name params] :opts} →
{:ctx new-ctx :entered state-or-nil}. Pure: no :src runs here.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 |