secretary
secretary copied to clipboard
dispatch! not dispatching
Using [org.clojure/clojurescript "0.0-2280"] the following works in [secretary "1.1.1"] but not in [secretary "1.2.0"]
(def history (Html5History.))
(.setUseFragment history false)
(defroute "test" []
(log "TEST")
(set-html! (js/document.getElementById "main-container") "TEST"))
(events/listen history EventType.NAVIGATE
(fn [e] (secretary/dispatch! (.-token e))))
(.setEnabled history true)
@martinskou Hey, I'm not seeing the call to dispatch!? You'll likely want something along the lines of:
(let [h (js/goog.history.Html5History.)]
(events/listen h EventType.NAVIGATE #(secretary/dispatch! (.-token %)))
(doto h
(.setUseFragment false)
(.setPathPrefix "")
(.setEnabled true)))
I have updated the original issue, seems some code was missing.
@martinskou hmm, this is working for me. do you have a failing example somewhere i could poke at?
@martinskou did you get this resolved? anything i can help with?