(match-path path)The route the registered table gives path (a path with an optional query string, as the
browser's location would hold it): {:handler kw :route-params {kw string} :query-params {kw string}}, or nil when no route matches. Both param maps are {} when there are none.
Reads only the tables register-routes installed; needs no browser, no start!, and
changes no state.
It is the match navigation makes (the same code pushy calls), so when two registered tables match one path, the table registered first wins here as it does on screen.
(match-path "/projects/42?tab=logs") ;; => {:handler :project-detail :route-params {:id "42"} :query-params {:tab "logs"}} (match-path "/nowhere") ;; => nil
The route the registered table gives `path` (a path with an optional query string, as the
browser's location would hold it): `{:handler kw :route-params {kw string} :query-params
{kw string}}`, or nil when no route matches. Both param maps are `{}` when there are none.
Reads only the tables `register-routes` installed; needs no browser, no `start!`, and
changes no state.
It is the match navigation makes (the same code pushy calls), so when two registered
tables match one path, the table registered first wins here as it does on screen.
(match-path "/projects/42?tab=logs")
;; => {:handler :project-detail :route-params {:id "42"} :query-params {:tab "logs"}}
(match-path "/nowhere")
;; => nil(registration-report){:routed [...] :registered [...] :duplicates [...] :orphan-routes [...] :orphan-registrations [...]}
routed are the handlers the route table can match; registered are the ones with
a routed-component implementation. A duplicate silently shadows a component; an
orphan is an ABSENCE — a route that renders blank, or a component nothing reaches —
which the registration-time collision check cannot see.
{:routed [...] :registered [...] :duplicates [...] :orphan-routes [...] :orphan-registrations [...]}
`routed` are the handlers the route table can match; `registered` are the ones with
a `routed-component` implementation. A duplicate silently shadows a component; an
orphan is an ABSENCE — a route that renders blank, or a component nothing reaches —
which the registration-time collision check cannot see.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 |