ALPHA. This namespace's API is subject to change.
URLHistoryProvider protocol and shared URL utility functions for statechart-driven routing. Implementations live in separate namespaces for CLJS dead-code elimination:
browser-history — BrowserURLHistory (CLJS-only, wraps js/window.history)simulated-history — SimulatedURLHistory (cross-platform, for testing)ALPHA. This namespace's API is subject to change. URLHistoryProvider protocol and shared URL utility functions for statechart-driven routing. Implementations live in separate namespaces for CLJS dead-code elimination: - `browser-history` — BrowserURLHistory (CLJS-only, wraps js/window.history) - `simulated-history` — SimulatedURLHistory (cross-platform, for testing)
(current-url-path)(current-url-path href)Returns the path segments of the given href (or current URL) as a vector of strings.
Returns the path segments of the given `href` (or current URL) as a vector of strings.
(find-target-by-leaf-name elements-by-id leaf-name)Given a normalized statechart's elements-by-id and a leaf-name string, finds the
route target element whose URL segment matches. Checks :route/segment first, then
falls back to (name (:route/target element)). Returns the element's :id or nil.
Given a normalized statechart's `elements-by-id` and a `leaf-name` string, finds the route target element whose URL segment matches. Checks `:route/segment` first, then falls back to `(name (:route/target element))`. Returns the element's `:id` or nil.
(find-target-by-leaf-name-deep elements-by-id leaf-name)Searches the parent chart's elements AND :route/reachable sets on istate elements.
If a direct match is found in elements-by-id (via element-segment), returns
{:target-id id :child? false}.
If the leaf-name matches a keyword in a :route/reachable set, returns
{:target-key matched-keyword :child? true :owner-id istate-id}.
Reachable matching checks :route/reachable-segments first (a map of keyword to
custom segment string), then falls back to matching by (name kw).
Searches the parent chart's elements AND `:route/reachable` sets on istate elements.
If a direct match is found in `elements-by-id` (via `element-segment`), returns
`{:target-id id :child? false}`.
If the leaf-name matches a keyword in a `:route/reachable` set, returns
`{:target-key matched-keyword :child? true :owner-id istate-id}`.
Reachable matching checks `:route/reachable-segments` first (a map of keyword to
custom segment string), then falls back to matching by `(name kw)`.(new-url-path old-href new-path)Given a complete browser URL: Replace the path with the given new path that retains all the prior elements (host/port/query string/hash). Returns a string that is the complete new URL.
Given a complete browser URL: Replace the path with the given new path that retains all the prior elements (host/port/query string/hash). Returns a string that is the complete new URL.
(-push-url! this href)Push href onto the history stack with a new monotonic index.
Push `href` onto the history stack with a new monotonic index.
(-replace-url! this href)Replace the current entry's URL without changing its index.
Replace the current entry's URL without changing its index.
(current-href this)Returns the current URL string, or nil.
Returns the current URL string, or nil.
(current-index this)Returns the monotonic index of the current history entry.
Returns the monotonic index of the current history entry.
(go-back! this)Navigate back one entry. No-op if already at the beginning.
Navigate back one entry. No-op if already at the beginning.
(go-forward! this)Navigate forward one entry. No-op if already at the end.
Navigate forward one entry. No-op if already at the end.
(set-popstate-listener! this callback)Register a (fn [index]) callback for popstate-like events, or nil to remove.
Register a `(fn [index])` callback for popstate-like events, or nil to remove.
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 |