| Field | Value |
|---|---|
| Status | Done |
| Priority | P1 |
| Created | 2026-02-18 |
| Completed | 2026-02-18 |
| Owner | AI |
ui_routing2.cljc has two overlapping guard mechanisms: the original busy? (boolean,
from ro/busy? component option) and the newer route-guard (keyword denial reason, from
ro/route-guard component option). The route-guard function checks ro/route-guard first,
then falls back to ro/busy?, and stores a ::denial-reason keyword in the data model.
This is redundant. The statechart already tracks what state the system is in — the active configuration tells you which component blocked routing, and that component's own state is already visible in app state. A separate denial reason code duplicates information the statechart already has.
Simplify: use busy? as the sole guard predicate. Remove route-guard, ::denial-reason,
and the ro/route-guard component option.
route-guard function from ui_routing2.cljcro/route-guard component option from ui_routes_options.cljc::denial-reason storage from record-failed-route!denial-reason public function from ui_routing2.cljcroutes guard transition uses busy? as its :conddenial-reason referenceroute-guard functionrecord-failed-route! — only store ::failed-route-event, remove
::denial-reason assignmentclear-override! — remove ::denial-reason clearing:cond route-guard to :cond busy?denial-reason public functionroute-guard def(ur2/denial-reason this session-id) reference| File | Change |
|---|---|
src/main/com/fulcrologic/statecharts/integration/fulcro/ui_routing2.cljc | Remove route-guard, denial-reason; use busy? as guard |
src/main/com/fulcrologic/statecharts/integration/fulcro/ui_routes_options.cljc | Remove ro/route-guard |
src/routing-demo2/com/fulcrologic/statecharts/routing_demo2/ui.cljs | Remove denial-reason usage |
ui-routes-test tests pass (they don't reference route-guard or denial-reason)busy? correctly blocks routing when a component's ro/busy? returns trueCan you improve this documentation?Edit on GitHub
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 |