-
-
Save andreortiz82/8182307b7476894bf425849b956664a8 to your computer and use it in GitHub Desktop.
URL parameter parsing with clojurescript
This file contains hidden or 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
(defn parse-params | |
"Parse URL parameters into a hashmap" | |
[] | |
(let [param-strs (-> (.-location js/window) (split #"\?") last (split #"\&"))] | |
(into {} (for [[k v] (map #(split % #"=") param-strs)] | |
[(keyword k) v])))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment