(add-state-machine! state-machine)Adds the state machine handling to the re-frame registry for the given state machine.
Detects existing event handlers and interceptor chains, and replaces them with a new interceptor chain that includes the locket interceptor.
Creates event handlers if they do not exist.
Leaves metadata on the interceptor change to indicate that we've been in here and messed around
Adds the state machine handling to the re-frame registry for the given state machine. Detects existing event handlers and interceptor chains, and replaces them with a new interceptor chain that includes the locket interceptor. Creates event handlers if they do not exist. Leaves metadata on the interceptor change to indicate that we've been in here and messed around
(all-transitions state-machine)Returns all the unique transitions (events) that a state machine handles
Returns all the unique transitions (events) that a state machine handles
(install-state-machine! state-machine)Installs a locket state machine. This function is side-effecting and alters the re-frame registry. It should be called after the definitions of the related event handlers.
Installs a locket state machine. This function is side-effecting and alters the re-frame registry. It should be called after the definitions of the related event handlers.
(interceptor id)Generic interceptor for state machine interactions.
path-fn is called on the event-v of the event to find the path to updatedebug-fn will be called with the transition data if debug? is trueGeneric interceptor for state machine interactions. * Updates the state of the state machine based on the reframe event * Removes any events when the transition is not found in the state machine. * `path-fn` is called on the event-v of the event to find the path to update * The `debug-fn` will be called with the transition data if debug? is true
(patch-state-machine state-machine)Patch up the state machine Ensure the state-machine has a path-fn, by constructing it from the id if not provided.
Patch up the state machine Ensure the state-machine has a path-fn, by constructing it from the id if not provided.
(remove-state-machine! id)Removes the state machine handling from the re-frame registry for the given state machine.
Removes the state machine handling from the re-frame registry for the given state machine.
(state id db)(state id db query-v)Returns the current state of a state machine, given the id, a re-frame db and an optional query-v
Returns the current state of a state machine, given the id, a re-frame db and an optional query-v
(transition->str transition)Takes fired transition data and turns it into a neat string representation
Takes fired transition data and turns it into a neat string representation
(transitions id db)(transitions id db query-v)Returns the transitions from the current state of a state machine
Returns the transitions from the current state of a state machine
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 |