devcards
devcards copied to clipboard
defcard-rg without a name causes compilation error
Minimal code to reproduce:
(defn hello []
[:div "hello"])
(defcard-rg
[hello])
;; [Figwheel:SEVERE] java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.Associative
I suspect that the problem is related to devcards.core/merge-options and macro expansion.
I would like to propose to change the default value 'reagent-card used for the name, as it is likely that the user will use it by luck and run into unexpected behaviour - as I did.
'__reagent-card would be better.
Same remark for 'card -> '__card
It appears that the compilation error is happening because of the assoc at https://github.com/bhauman/devcards/blob/master/src/devcards/core.clj#L154 which is applied onto unevaluated code from devcards.core/merge-options.