-
-
Save jrheard/16269f93dfc51d511792 to your computer and use it in GitHub Desktop.
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
(defn childreno [node children] | |
(fresh [r] | |
(resto node r) | |
(resto r children))) | |
(defn nodes-existo [condition nodes out] | |
(fresh [node remaining-nodes] | |
(conso node remaining-nodes nodes) | |
(conde | |
[(condition node) (== node out)] | |
[(fresh [children] | |
(childreno node children) | |
(nodes-existo condition children out))] | |
[(nodes-existo condition remaining-nodes out)]))) | |
(defn get-elements-by-class-name [dom class-name] | |
(run* [q] | |
(nodes-existo #(has-classnameo % class-name) dom q))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment