reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
andrewboltachev 2020-12-30T00:44:24.453300Z

Hello

andrewboltachev 2020-12-30T00:45:42.454Z

How do I unleran Reitit router to follow links like # (they are just actions on a page for me)?

andrewboltachev 2020-12-30T00:46:09.454500Z

Using even :ignore-anchor-click? (fn [router e el uri] true) didn't help — it's still following

andrewboltachev 2020-12-30T01:04:37.455Z

alright, this is 'cause of clicks to "#" causing popstate event

andrewboltachev 2020-12-30T01:05:07.455500Z

i.e. it's this:

:listen-key (gevents/listen js/window goog.events.EventType.POPSTATE handler false)
event handler that fires

andrewboltachev 2020-12-30T02:13:47.455800Z

:ignore-anchor-click?
     (fn [router e el uri]
       ;; Add additional check on top of the default checks\
       (and     
         (rfh/ignore-anchor-click? router e el uri)  
         (not (let [href (or (.-href el) "#")
                    result (clojure.string/includes? href "#")]
                (js/console.log "href" href)
                (when result    
                  (.preventDefault e)
                  (js/console.log "will prevent by href" href))
               result))))

andrewboltachev 2020-12-30T02:13:55.456Z

ended up doing like this

jacekschae 2020-12-30T12:43:51.458200Z

Hi all in Reitit Channel. Wanted to let you know that http://LearnReitit.com course is ready. It’s around 9h of content and it’s still available in early access price. If video courses are something you enjoy check it out!

👍 4