(dispatch event-v)
Returns a clj-statecharts action that will dispatch a re-frame event vector
event-v
.
See dispatch-by
for details about the params appended to the event
vector.
Returns a clj-statecharts action that will dispatch a re-frame event vector `event-v`. See [[dispatch-by]] for details about the params appended to the event vector.
(dispatch-by f)
Returns a clj-statecharts action that will dispatch to re-frame.
f
, a function of state-map
and state-event
, should return the re-frame
event vector to be dispatched.
The dispatched event vector will receive two additional params, again, the
state-map
and state-event
. If the state-event
was triggered by a
transition that received any additional result data, that will be available in
the :data
key of the state-event
.
Returns a clj-statecharts action that will dispatch to re-frame. `f`, a function of `state-map` and `state-event`, should return the re-frame event vector to be dispatched. The dispatched event vector will receive two additional params, again, the `state-map` and `state-event`. If the `state-event` was triggered by a transition that received any additional result data, that will be available in the `:data` key of the `state-event`.
(dispatch-in evt-path)
Returns a clj-statecharts action that will dispatch a re-frame event vector
that is stored in the state-map
at the evt-path
.
See dispatch-by
for details about the params appended to the event
vector.
Returns a clj-statecharts action that will dispatch a re-frame event vector that is stored in the `state-map` at the `evt-path`. See [[dispatch-by]] for details about the params appended to the event vector.
(initialize-after state-map-path fsm)
(initialize-after state-map-path fsm state-map)
Returns a re-frame interceptor that will initialize a state-map with the
fsm
and store it at the given state-map-path
.
See initialize-in
for details about the optional state-map
.
Returns a re-frame interceptor that will initialize a state-map with the `fsm` and store it at the given `state-map-path`. See [[initialize-in]] for details about the optional `state-map`.
(initialize-in db state-map-path fsm)
(initialize-in db state-map-path fsm state-map)
Initialize a state map using the given fsm
, and store it in the db
at
state-map-path
.
If provided, state-map
is used as the initial value of the state map (in
clj-statecharts terminology, this is also known as the state "context".)
This allows the state map to hold any additional data it may need when being
transitioned. See, for example, dispatch-in
.
Initialize a state map using the given `fsm`, and store it in the `db` at `state-map-path`. If provided, `state-map` is used as the initial value of the state map (in clj-statecharts terminology, this is also known as the state "context".) This allows the state map to hold any additional data it may need when being transitioned. See, for example, [[dispatch-in]].
(machine spec)
(machine spec {:keys [clock] :or {clock (clock/wall-clock)}})
Returns a clj-statecharts state machine described by the spec.
These machines' delayed events will only work if their states are created by
initialize-in
or ::state/initialize
.
Returns a clj-statecharts state machine described by the spec. These machines' delayed events will only work if their states are created by [[initialize-in]] or `::state/initialize`.
Access the clj-statecharts state stored in a state map.
Access the clj-statecharts state stored in a state map.
(transition-after state-map-path fsm state-event)
Returns a re-frame interceptor that will transition a state-map stored at the
given state-map-path
, using the fsm
and state-event
.
Returns a re-frame interceptor that will transition a state-map stored at the given `state-map-path`, using the `fsm` and `state-event`.
(transition-in db state-map-path fsm state-event)
Transition a state map stored in the db
at state-map-path
, using the
given fsm
and state-event
.
Transition a state map stored in the `db` at `state-map-path`, using the given `fsm` and `state-event`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close