Prescriptive Talos configuration helpers
Europa constrains the Talos model for state machines:
- State transitions are driven by an event stream
- Transitions conditions and actions are uniform with respect to the target state
- The context must be an initialized with a
state
property that’s an instance of an Observable - The state includes
forward
andback
properties to support forward and back transitions
If you don’t need or want these features, you should use Talos directly.
Machines are constructed using the make
function by providing dictionaries for the states and transitions.
import Europa from "@dashkite/europa"
import transitions from "./transitions"
import states from "./states"
machine = Europa.make { states, transitions }
A machine can be started by providing the initial state, returning the event stream that drives it:
state = Observable.from forward: [], back: []
events = await Europa.start { state, machine }
events.enqueue name: "home"
TBD
TBD
TBD