Liking cljdoc? Tell your friends :D

thi.ng.domus.router


format-routecljs

(format-route route params)

Takes a route spec map and map of params, returns formatted URI path

Takes a route spec map and map of params, returns formatted URI path
raw docstring

format-route-for-idcljs

(format-route-for-id routes id args)

Composition of route-for-id and format-route.

Composition of route-for-id and format-route.
raw docstring

get-hash-routecljs

(get-hash-route)

html5-historycljs

(html5-history frag?)

localhost?cljs

(localhost?)

replace-route!cljs

(replace-route! routes id params)

route-for-idcljs

(route-for-id routes id)

Takes vector of routes and route id to find, returns route spec.

Takes vector of routes and route id to find, returns route spec.
raw docstring

set-hash-route!cljs

(set-hash-route! routes id params)

set-location!cljs

(set-location! url)

start!cljs

(start! {:keys [history routes init default dispatch auth]})

Takes a map of following keys, configures and attaches router to given history object:

  • :history - goog.Html5History instance

  • :routes - vector of route specs

  • :init - init URI path

  • :default - default route spec

  • :dispatch - user nav change handler fn

  • :auth - user auth fn

  • init URI can be used to force a certain entry route (default nil)

  • handler fn is called on nav change with matched route spec

  • auth fn also called with single route spec during matching and can be used to restrict access to routes (e.g. if user not logged in etc.). Only called for routes with :auth key enabled and must return truthy value for route to succeed

Takes a map of following keys, configures and attaches router to
given history object:

- :history  - goog.Html5History instance
- :routes   - vector of route specs
- :init     - init URI path
- :default  - default route spec
- :dispatch - user nav change handler fn
- :auth     - user auth fn

- init URI can be used to force a certain entry route (default nil)
- handler fn is called on nav change with matched route spec
- auth fn also called with single route spec during matching and
  can be used to restrict access to routes (e.g. if user not logged
  in etc.). Only called for routes with :auth key enabled and must
  return truthy value for route to succeed
raw docstring

trigger!cljs

(trigger! history uri)

Takes URI path and sets as history token.

Takes URI path and sets as history token.
raw docstring

(virtual-link history uri)

Helper :on-click handler for internal SPA links. Calls preventDefault on event and calls trigger with given URI path.

Helper :on-click handler for internal SPA links. Calls
preventDefault on event and calls trigger with given URI path.
raw docstring

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

× close