These features may be implemented in the future.
In xstate, the state object has two keys value
and context
{
value: "waiting",
context: {
user: "jack",
backoff: 3000
}
}
But in clj-statecharts the state map is a flat map:
{:_state :waiting
:user "jack"
:backoff 3000}
In the state map, any underscored key (e.g. _state
) is internal to
clj-statecharts, which means your application code should not modify it (e.g. in an
context function). The others are the application specific data (equivalent to the
"context" of xstate).
The reason behind this is that after using the xstate-like two-level map structure in some real world projects, it's obvious that the two-level map is hard to integrate into an existing project, e.g. putting the state inside a re-frame db.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close