Skip to content

Commit

Permalink
LSB
Browse files Browse the repository at this point in the history
* Added statechart for managing dispatch
* Got map/markers set up for dispatch
* Installed fulcro statechart support
  • Loading branch information
awkay committed Nov 2, 2024
1 parent 55478ac commit bcb8a7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/main/com/fulcrologic/statecharts/elements.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,11 @@
(script {:expr (fn [env data] ...)})
```
You can include the number of args that your execution env expects.
"
[[env-sym data-sym] & body]
[[env-sym data-sym :as args] & body]
`(script {:diagram/label ~(expr-label body)
:expr (fn [~env-sym ~data-sym]
:expr (fn ~args
~@body)}))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
6 changes: 3 additions & 3 deletions src/main/com/fulcrologic/statecharts/integration/fulcro.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
a final state.
Returns the new session-id of the statechart."
[app {:keys [machine session-id data]
[app-ish {:keys [machine session-id data]
:or {session-id (new-uuid)
data {}}}]
[::fulcro-appish [:map
Expand All @@ -197,8 +197,8 @@
[:data {:optional true} map?]] => (? ::sc/session-id)]
(when machine
(let [env (or
(statechart-env app)
(throw (ex-info "Statecharts are not installed on that app." {})))
(statechart-env app-ish)
(throw (ex-info "Statecharts are not installed." {})))
{::sc/keys [processor working-memory-store]} env
s0 (sp/start! processor env machine (cond-> {::sc/session-id session-id
:org.w3.scxml.event/invokeid (new-uuid)
Expand Down

0 comments on commit bcb8a7e

Please sign in to comment.