Liking cljdoc? Tell your friends :D

com.fulcrologic.statecharts.integration.fulcro.routing.url-history

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)
raw docstring

current-urlclj/s

(current-url)
source

current-url-pathclj/s

(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.
sourceraw docstring

find-target-by-leaf-nameclj/s

(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.
sourceraw docstring

find-target-by-leaf-name-deepclj/s

(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)`.
sourceraw docstring

new-url-pathclj/s

(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.
sourceraw docstring

push-url!clj/s

(push-url! href)
source

replace-url!clj/s

(replace-url! href)
source

URLHistoryProviderclj/sprotocol

-push-url!clj/s

(-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!clj/s

(-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-hrefclj/s

(current-href this)

Returns the current URL string, or nil.

Returns the current URL string, or nil.

current-indexclj/s

(current-index this)

Returns the monotonic index of the current history entry.

Returns the monotonic index of the current history entry.

go-back!clj/s

(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!clj/s

(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!clj/s

(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.
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close