Created
January 1, 2014 21:56
-
-
Save haywoood/8211908 to your computer and use it in GitHub Desktop.
Routing problems
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
(ns puree.core | |
(:require-macros [cljs.core.async.macros :refer [go]] | |
[secretary.macros :refer [defroute]]) | |
(:require [cljs.core.async :as async :refer [>! <! put! chan]] | |
[goog.events :as events] | |
[clojure.browser.repl] | |
[secretary.core :as secretary] | |
[om.core :as om :include-macros true] | |
[om.dom :as dom :include-macros true] | |
[puree.state :as state] | |
[puree.components.header :as header]) | |
(:import [goog History] | |
[goog.history EventType])) | |
(enable-console-print!) | |
(defroute "/:message" {:as params} | |
(println (str "message: " (:message params)))) | |
(defroute "/" [] (println "home")) | |
(def history (History.)) | |
(events/listen history EventType/NAVIGATE | |
(fn [e] (secretary/dispatch! (.-token e)))) | |
(.setEnabled history true) | |
(defn puree [app owner] | |
(reify | |
om/IWillMount | |
(will-mount [_] | |
(println "...starting...")) | |
om/IRender | |
(render [_] | |
(dom/div #js {:className "puree-wrap"} | |
(header/build app owner))))) | |
(om/root state/app puree (.getElementById js/document "app")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment