Liking cljdoc? Tell your friends :D

hyperfiddle.router3

A reactive tree router

A reactive tree router
raw docstring

adaptive-keyclj

(adaptive-key key)

Return a lens focusing on the value at key in an associative data structure. When updating the focused value by a function f:

  • if value is a map, then the result is equivalent to {key (f value)} (trivial case),
  • if value is vector, then key must be a natural integer. The value at position key will be updated by f. If key is out of the array upper bound, the vector will be resized and padded with nil .
  • if value is neither a map nor a vector, then value will become {value (f nil)}.
  • if value is nil:
    • if key is a natural integer, then value will default to a vector,
    • otherwise value will default to a map.
Return a lens focusing on the value at `key` in an associative data structure.
When updating the focused value by a function `f`:
- if value is a map, then the result is equivalent to `{key (f value)}` (trivial case),
- if value is vector, then `key` must be a natural integer. The value at
position key will be updated by f. If `key` is out of the array upper bound,
the vector will be resized and padded with `nil` .
- if value is neither a map nor a vector, then value will become {value (f
nil)}.
- if value is `nil`:
  - if `key` is a natural integer, then value will default to a vector,
  - otherwise value will default to a map.
sourceraw docstring

as-vecclj

(as-vec x)
source

confirm-navigation?clj

A predicate called on user navigation intent. If false, the current navigation intent is prevented. Called during DOM event bubbling phase, it must be synchronous and therefore must be bound to a clojure function.

A predicate called on user navigation intent. If false, the current navigation intent is prevented.
Called during DOM event bubbling phase, it must be synchronous and therefore must be bound to a clojure function.
sourceraw docstring

current-pathclj

(current-path paths)
source

Current-route?clj

(Current-route? target-route)
source

current-route?clj

source

decodeclj

source

decode*clj

(decode* path)
source

encodeclj

source

encode*clj

(encode* route)
source

focuscljmacro

(focus path & body)
source

Focusclj

(Focus path Body-fn)
source

HTML5-Historyclj

(HTML5-History)
source

HTML5-Navigation-Intentsclj

(HTML5-Navigation-Intents history)
source

id-lensclj

source

identity-setterclj

(identity-setter structure f)
source

key-lensclj

(key-lens key)
source

lensclj

(lens getter-f setter-f)
source

(Link path Body)
source

(link path & body)
source

(Navigate! path)
source

normalizeclj

(normalize x)
source

normalize-route-valueclj

(normalize-route-value x)
source

OnBeforeNavigate!clj

(OnBeforeNavigate!)

Run for effect on history navigation

Run for effect on history navigation
sourceraw docstring

OnNavigateclj

(OnNavigate Callback)
(OnNavigate node Callback)

Will call Callback on internal router/Link click. Callback takes 2 arguments:

  • the route to navigate to
  • the dom click js event.
Will call `Callback` on internal `router/Link` click. `Callback` takes 2 arguments:
- the route to navigate to
- the dom click js event.
sourceraw docstring

overclj

(over lens f structure)
source

padclj

(pad n coll)
source

pathclj

The current path

The current path
sourceraw docstring

path-lensclj

(path-lens path)

Given a sequence of keys in an associative data structure (e.g. [:foo :bar 0 :baz]), return a lens focusing on the value at the end of the path. An empty path (e.g. []) is an identity.

Given a sequence of keys in an associative data structure (e.g. [:foo :bar
0 :baz]), return a lens focusing on the value at the end of the path. An empty
path (e.g. []) is an identity.
sourceraw docstring

pathsclj

A stack of paths

A stack of paths
sourceraw docstring

ReplaceState!clj

(ReplaceState! path)
source

resolve-pathclj

(resolve-path path)
(resolve-path stack [x & xs])

Given a path eventually containing relative path components (e.g. '., '.., or '/), resolve the final path.

  • . is a noop,
  • .. navigates one level up,
  • / navigates to the root. e.g. [:foo '. :bar] => [:foo :bar] [:foo '. '. :bar] => [:foo :bar] [:foo :bar '..] => [:foo] [:foo :bar '.. :baz] => [:foo :baz] ['.. :foo] => [:foo] ['/] => [] [:foo '/] => [] [:foo :bar '/ :baz] => [:baz]
Given a path eventually containing relative path components (e.g. `'.`, `'..`, or `'/`), resolve the final path.
- `.` is a noop,
- `..` navigates one level up,
- `/` navigates to the root.
e.g.
[:foo '. :bar]       => [:foo :bar]
[:foo '. '. :bar]    => [:foo :bar]
[:foo :bar '..]      => [:foo]
[:foo :bar '.. :baz] => [:foo :baz]
['.. :foo]           => [:foo]
['/]                 => []
[:foo '/]            => []
[:foo :bar '/ :baz]  => [:baz]
sourceraw docstring

root-routeclj

Top level route

Top level route
sourceraw docstring

routeclj

Current rout in the scope of a router

Current rout in the scope of a router
sourceraw docstring

Route-atclj

(Route-at path)
source

Route-forclj

(Route-for path)
(Route-for path value)
source

Routerclj

(Router history BodyFn)
source

routercljmacro

(router history & body)
source

safe-popclj

(safe-pop coll)
source

setclj

(set lens value structure)
source

set-keyclj

(set-key m old-key new-key)

Replaces old-key in map m by new-key without altering the corresponding value. Similar to clojure.set/rename-keys, but faster and for a single key.

Replaces `old-key` in map `m` by `new-key` without altering the corresponding value.
Similar to `clojure.set/rename-keys`, but faster and for a single key.
sourceraw docstring

simplifyclj

(simplify route)
source

(split-link-path path)
source

update-keyclj

(update-key m k f)

Update a key in a map. Replaces key k in map m by the result of (f k). The corresponding value is preserved.

Update a key in a map. Replaces key `k` in map `m` by the result of `(f k)`.
The corresponding value is preserved.
sourceraw docstring

viewclj

(view lens structure)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close