Liking cljdoc? Tell your friends :D

locket.core


add-state-machine!clj/s

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

all-transitionsclj/s

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

install-state-machine!clj/s

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

interceptorclj/s

(interceptor id)

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

patch-state-machineclj/s

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

remove-state-machine!clj/s

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

stateclj/s

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

transition->strclj/s

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

transitionsclj/s

(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
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