Liking cljdoc? Tell your friends :D

bangmod.router.match

The pure half of URL matching: a URL against a seq of compiled route tables, with the tables passed in. bangmod.router.internal/parse (pushy's matcher) and bangmod.router.core/match-path both delegate here, so a URL resolves the same way for navigation and for a caller asking directly. Free of pushy and reagent, so it loads under :node-test.

The pure half of URL matching: a URL against a seq of compiled route tables, with the
tables passed in. `bangmod.router.internal/parse` (pushy's matcher) and
`bangmod.router.core/match-path` both delegate here, so a URL resolves the same way for
navigation and for a caller asking directly. Free of pushy and reagent, so it loads under
`:node-test`.
raw docstring

bangmod.router.table

The pure half of route compilation: the bidi-table walk, minus the defmethod/registry side effects, so it can be unit-tested under :node-test (bangmod.router.internal cannot load there — pushy and reagent touch js/window at load time).

Grammar accepted — bidi's, with one change: a leaf is [handler-keyword component] instead of a bare handler.

RoutePair := [Pattern Matched] Matched := [handler-kw component] | {Pattern Matched ...} | [RoutePair ...]

Patterns (strings, ["/projects/" :id] vectors, ...) are never walked, so a path parameter keyword is never mistaken for a handler.

The pure half of route compilation: the bidi-table walk, minus the defmethod/registry
side effects, so it can be unit-tested under `:node-test` (`bangmod.router.internal`
cannot load there — pushy and reagent touch `js/window` at load time).

Grammar accepted — bidi's, with one change: a leaf is `[handler-keyword component]`
instead of a bare handler.

  RoutePair := [Pattern Matched]
  Matched   := [handler-kw component] | {Pattern Matched ...} | [RoutePair ...]

Patterns (strings, `["/projects/" :id]` vectors, ...) are never walked, so a path
parameter keyword is never mistaken for a handler.
raw docstring

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