Created
January 17, 2013 19:19
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 selector [data] | |
(cond | |
(or (string? data) (keyword? data)) (name data) | |
(coll? data) (clojure.string/join " " (map selector data)))) | |
(defmacro sel | |
([data] | |
`(sel ~data js/document)) | |
([data base] | |
`(.querySelector ~base ~(selector data)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment