Liking cljdoc? Tell your friends :D

reitit.frontend.history

Provides integration to hash-change or HTML5 History events.

Provides integration to hash-change or HTML5 History
events.
raw docstring

FragmentHistorycljs

source

Historycljsprotocol

-stopcljs

(-stop this)

Remove event listeners

Remove event listeners

-hrefcljs

(-href this path)

-on-navigatecljs

(-on-navigate this path)

-initcljs

(-init this)

Create event listeners

Create event listeners

-get-pathcljs

(-get-path this)
source

hrefcljs

(href history k)
(href history k params)
(href history k params query)
source

Html5Historycljs

source

ignore-anchor-click?cljs

(ignore-anchor-click? router e el uri)

Precicate to check if the anchor click event default action should be ignored. This logic will ignore the event if anchor href matches the route tree, and in this case the page location is updated using History API.

Precicate to check if the anchor click event default action
should be ignored. This logic will ignore the event
if anchor href matches the route tree, and in this case
the page location is updated using History API.
sourceraw docstring

push-statecljs

(push-state history k)
(push-state history k params)
(push-state history k params query)

Sets the new route, leaving previous route in history.

Sets the new route, leaving previous route in history.
sourceraw docstring

replace-statecljs

(replace-state history k)
(replace-state history k params)
(replace-state history k params query)

Replaces current route. I.e. current route is not left on history.

Replaces current route. I.e. current route is not left on history.
sourceraw docstring

start!cljs

(start! router on-navigate)
(start! router
        on-navigate
        {:keys [use-fragment] :or {use-fragment true} :as opts})

This registers event listeners on HTML5 history and hashchange events.

Returns History object.

When using with development workflow like Figwheel, remember to remove listeners using stop! call before calling start! again.

Parameters:

  • router The Reitit router.
  • on-navigate Function to be called when route changes. Takes two parameters, ´match´ and ´history´ object.

Options:

  • :use-fragment (default true) If true, onhashchange and location hash are used to store current route.

Options (Html5History):

  • :ignore-anchor-click? Function (router, event, anchor element, uri) which will be called to check if the anchor click event should be ignored. To extend built-in check, you can call reitit.frontend.history/ignore-anchor-click? function, which will ignore clicks if the href matches route tree.
This registers event listeners on HTML5 history and hashchange events.

Returns History object.

When using with development workflow like Figwheel, remember to
remove listeners using stop! call before calling start! again.

Parameters:
- router         The Reitit router.
- on-navigate    Function to be called when route changes. Takes two parameters, ´match´ and ´history´ object.

Options:
- :use-fragment  (default true) If true, onhashchange and location hash are used to store current route.

Options (Html5History):
- :ignore-anchor-click?  Function (router, event, anchor element, uri) which will be called to
                         check if the anchor click event should be ignored.
                         To extend built-in check, you can call `reitit.frontend.history/ignore-anchor-click?`
                         function, which will ignore clicks if the href matches route tree.
sourceraw docstring

stop!cljs

(stop! history)
source

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

× close