Created
June 8, 2014 08:08
-
-
Save dbushenko/65ff9e5e315000e34725 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def current-page (atom nil)) | |
(def history (History.)) | |
(defn change-page [newPage] | |
(.setToken history newPage) | |
(reset! current-page newPage)) | |
... | |
(defn start [] | |
(secretary/set-config! :prefix "#") | |
(goog.events/listen history EventType/NAVIGATE #(secretary/dispatch! (.-token %))) | |
(add-navbar) | |
; TODO: use server push | |
(js/setInterval #(sync-user-data nil) 3000) | |
(.setEnabled history true)) | |
(set! (.-onload js/window) #(em/wait-for-load (sync-user-data start))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment