From 69ae860a0eed04af3a1e464877cc372d61dd3f01 Mon Sep 17 00:00:00 2001 From: Dan Holmsand Date: Fri, 19 Dec 2014 18:35:49 +0100 Subject: [PATCH] Streamline template.cljs a little --- src/reagent/impl/template.cljs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/reagent/impl/template.cljs b/src/reagent/impl/template.cljs index b279328..329f7f4 100644 --- a/src/reagent/impl/template.cljs +++ b/src/reagent/impl/template.cljs @@ -21,8 +21,7 @@ (symbol? x))) (defn hiccup-tag? [x] - (or (keyword? x) - (symbol? x) + (or (named? x) (string? x))) (defn valid-tag? [x] @@ -41,12 +40,12 @@ (aget o k))) (defn cached-prop-name [k] - (if-not (named? k) - k - (if-let [k' (obj-get prop-name-cache (name k))] + (if (named? k) + (if-some [k' (obj-get prop-name-cache (name k))] k' (aset prop-name-cache (name k) - (util/dash-to-camel k))))) + (util/dash-to-camel k))) + k)) (defn convert-prop-value [x] (cond (or (string? x) (number? x) (fn? x)) x @@ -185,7 +184,7 @@ (def tag-name-cache #js{}) (defn cached-parse [x] - (if-let [s (obj-get tag-name-cache (name x))] + (if-some [s (obj-get tag-name-cache (name x))] s (aset tag-name-cache (name x) (parse-tag x))))