add some utility components

This commit is contained in:
Gered 2016-06-18 10:05:49 -04:00
parent bc47be1f94
commit 527fca4acb

View file

@ -0,0 +1,16 @@
(ns webtools.reagent.components)
(defn ->keyed-comps
[components]
(map-indexed
(fn [idx comp]
(if (vector? comp)
(with-meta comp {:key idx})
comp))
components))
(defn raw-html
([comp html-content]
(raw-html comp nil html-content))
([comp props html-content]
[comp (assoc props :dangerouslySetInnerHTML {:__html html-content})]))