Skip to content

Commit

Permalink
Improve compile-hiccup macro
Browse files Browse the repository at this point in the history
  • Loading branch information
wavejumper committed Aug 19, 2020
1 parent feedcc8 commit c640863
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion rehook-dom/src/rehook/dom.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,17 @@

([$ e props child & children]
(let [children (cons child children)]
(apply list $ e props (keep (partial compile-hiccup $) children)))))
(apply list $ e props (keep (fn [e]
(cond
(vector? e)
(apply compile-hiccup $ e)

(or (nil? e) (string? e) (number? e))
e

:else
`(eval-hiccup ~$ ~e)))
children)))))

#?(:clj
(defmacro html [$ component]
Expand Down

0 comments on commit c640863

Please sign in to comment.