Skip to content

Instantly share code, notes, and snippets.

@haywoood
Created January 1, 2014 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haywoood/8211908 to your computer and use it in GitHub Desktop.
Save haywoood/8211908 to your computer and use it in GitHub Desktop.
Routing problems
(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