Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dispatch! not dispatching #45

Open
martinskou opened this issue Aug 5, 2014 · 4 comments
Open

dispatch! not dispatching #45

martinskou opened this issue Aug 5, 2014 · 4 comments
Labels

Comments

@martinskou
Copy link

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)
@gf3
Copy link
Collaborator

gf3 commented Aug 6, 2014

@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)))

@gf3 gf3 added the question label Aug 6, 2014
@martinskou
Copy link
Author

I have updated the original issue, seems some code was missing.

@gf3
Copy link
Collaborator

gf3 commented Aug 15, 2014

@martinskou hmm, this is working for me. do you have a failing example somewhere i could poke at?

@gf3
Copy link
Collaborator

gf3 commented Sep 25, 2014

@martinskou did you get this resolved? anything i can help with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants