(dom-find dom key match)
find dom element
(-> (dom/dom-compile [:mock/pane {:children [[:mock/pane {:tag "A"}] [:mock/pane {:tag "B"}]]}]) (dom-find :tag identity) str read-string) => [:- :mock/pane {:tag "A"}]
find dom element (-> (dom/dom-compile [:mock/pane {:children [[:mock/pane {:tag "A"}] [:mock/pane {:tag "B"}]]}]) (dom-find :tag identity) str read-string) => [:- :mock/pane {:tag "A"}]
(dom-find-all dom key match)
(dom-find-all dom key match state)
finds all matching dom elements
(-> (dom/dom-compile [:mock/pane {:children [[:mock/pane {:tag "A"}] [:mock/pane {:tag "B"}]]}]) (dom-find-all :tag string?) str read-string) => [[:- :mock/pane {:tag "A"}] [:- :mock/pane {:tag "B"}]]
finds all matching dom elements (-> (dom/dom-compile [:mock/pane {:children [[:mock/pane {:tag "A"}] [:mock/pane {:tag "B"}]]}]) (dom-find-all :tag string?) str read-string) => [[:- :mock/pane {:tag "A"}] [:- :mock/pane {:tag "B"}]]
(dom-find-all-props props key match state)
finds all dom elements within props
(-> (dom/dom-compile [:mock/pane {:children [[:mock/pane {:tag "A"}] [:mock/pane {:tag "B"}]]}]) :props (dom-find-all-props :tag string? (atom [])) str read-string) => [[:- :mock/pane {:tag "A"}] [:- :mock/pane {:tag "B"}]]
finds all dom elements within props (-> (dom/dom-compile [:mock/pane {:children [[:mock/pane {:tag "A"}] [:mock/pane {:tag "B"}]]}]) :props (dom-find-all-props :tag string? (atom [])) str read-string) => [[:- :mock/pane {:tag "A"}] [:- :mock/pane {:tag "B"}]]
(dom-find-props props key match)
find dom element within props
(-> (dom/dom-compile [:mock/pane {:child [:mock/pane {:tag "A"}]}]) :props (dom-find-props :tag "A") str read-string) => [:- :mock/pane {:tag "A"}]
find dom element within props (-> (dom/dom-compile [:mock/pane {:child [:mock/pane {:tag "A"}]}]) :props (dom-find-props :tag "A") str read-string) => [:- :mock/pane {:tag "A"}]
(dom-match? dom key match)
tests dom to match on either function or value
(dom-match? (dom/dom-compile [:mock/pane {:hello "world"}]) :hello string?) => true
tests dom to match on either function or value (dom-match? (dom/dom-compile [:mock/pane {:hello "world"}]) :hello string?) => true
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close