Skip to content

Instantly share code, notes, and snippets.

@fmw
Created August 5, 2011 00:46
Show Gist options
  • Save fmw/1126686 to your computer and use it in GitHub Desktop.
Save fmw/1126686 to your computer and use it in GitHub Desktop.
vix routes function
(def h (atom nil))
(defn routes [uri-path]
(compare-and-set! h nil (new goog.history.Html5History))
(cond
(re-matches #"^/admin/[^/]+/new$" uri-path) (editor/start :new uri-path)
(re-matches #"^/admin/[^/]+/edit.+" uri-path) (editor/start :edit uri-path)
(re-matches #"^/admin/[^/]+/overview$" uri-path) (feed/list-documents uri-path)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment