Liking cljdoc? Tell your friends :D

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

ALPHA. This namespace's API is subject to change.

URLCodec protocol and codec-agnostic functions that convert statechart configuration into URLs. The protocol defines encode/decode; implementations live in separate namespaces (e.g. url-codec-transit for the default transit+base64 codec).

ALPHA. This namespace's API is subject to change.

URLCodec protocol and codec-agnostic functions that convert statechart
configuration into URLs. The protocol defines encode/decode; implementations
live in separate namespaces (e.g. `url-codec-transit` for the default
transit+base64 codec).
raw docstring

configuration->urlclj/s

(configuration->url elements-by-id configuration data-model codec)

Combines path and params into a URL string. Builds an encoding context and delegates to the codec.

Combines path and params into a URL string. Builds an encoding context and delegates
to the codec.
sourceraw docstring

deep-configuration->urlclj/s

(deep-configuration->url state-map registry session-id local-data-path-fn codec)

Walks the full invocation tree starting from session-id to build a URL that includes child chart state. Uses the same tree-walk pattern as deep-busy? in routing.

state-map is the current Fulcro app state. registry is the statechart registry. local-data-path-fn is a function (fn [session-id & ks]) returning the Fulcro state path for a session's local data (to avoid circular dependency on fulcro_impl). codec is a URLCodec instance.

Walks the full invocation tree starting from `session-id` to build a URL that includes
child chart state. Uses the same tree-walk pattern as `deep-busy?` in routing.

`state-map` is the current Fulcro app state. `registry` is the statechart registry.
`local-data-path-fn` is a function `(fn [session-id & ks])` returning the Fulcro state
path for a session's local data (to avoid circular dependency on fulcro_impl).
`codec` is a URLCodec instance.
sourceraw docstring

element-segmentclj/s

(element-segment element)

Returns the URL path segment for a route element. Uses :route/segment when present, otherwise falls back to (name (:route/target element)).

Returns the URL path segment for a route `element`. Uses `:route/segment` when
present, otherwise falls back to `(name (:route/target element))`.
sourceraw docstring

params-from-configurationclj/s

(params-from-configuration elements-by-id configuration data-model)

Given a normalized statechart's elements-by-id, the active configuration, and the statechart's data model map, collects [:routing/parameters <state-id>] for each active route state. Returns a map keyed by state ID, or nil if no state has params.

The data-model is the session's local data map (from working memory).

Given a normalized statechart's `elements-by-id`, the active `configuration`, and the
statechart's data model map, collects `[:routing/parameters <state-id>]` for each active
route state. Returns a map keyed by state ID, or nil if no state has params.

The `data-model` is the session's local data map (from working memory).
sourceraw docstring

path-from-configurationclj/s

(path-from-configuration elements-by-id configuration)

Given a normalized statechart's elements-by-id and a set of active state IDs (configuration), finds the active leaf route states and walks up the element tree collecting :route/target simple names from each ancestor. Returns a path string like /AdminPanel/AdminUserDetail.

A leaf route state is one that has :route/target and no children with :route/target. If multiple leaf routes are active (parallel regions), returns the path for the first one found.

Given a normalized statechart's `elements-by-id` and a set of active state IDs (`configuration`),
finds the active leaf route states and walks up the element tree collecting `:route/target`
simple names from each ancestor. Returns a path string like `/AdminPanel/AdminUserDetail`.

A leaf route state is one that has `:route/target` and no children with `:route/target`.
If multiple leaf routes are active (parallel regions), returns the path for the first one found.
sourceraw docstring

URLCodecclj/sprotocol

decode-urlclj/s

(decode-url this href route-elements)

Given a URL string and route-elements map, return {:leaf-id <state-id> :params <map>}, or nil. May return {:params <map>} without :leaf-id when params are present but the leaf segment doesn't match a known route element (e.g. cross-chart targets).

Given a URL string and route-elements map, return {:leaf-id <state-id> :params <map>},
or nil. May return {:params <map>} without :leaf-id when params are present but the
leaf segment doesn't match a known route element (e.g. cross-chart targets).

encode-urlclj/s

(encode-url this context)

Given an encoding context map, return a URL path string (with query if needed). Context keys: :segments (vector of state IDs), :params (map keyed by state-id), :route-elements (map of state-id -> element map).

Given an encoding context map, return a URL path string (with query if needed).
Context keys: :segments (vector of state IDs), :params (map keyed by state-id),
:route-elements (map of state-id -> element map).
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