Cleanup and fix for ClojureScript 0.0-2411

This commit is contained in:
Dan Holmsand 2014-12-07 21:07:32 +01:00
parent fc2c59c3e1
commit 59b2e6d6ee
5 changed files with 12 additions and 16 deletions

View File

@ -1,8 +1,6 @@
(ns reagentdemo.common
(:require [reagent.core :as reagent :refer [atom]]
[reagent.debug :refer-macros [dbg println]]
[clojure.string :as string]
[reagentdemo.syntax :as syntax]))
[reagent.debug :refer-macros [dbg println]]))
(defn demo-component []
(let [showing (atom true)]

View File

@ -1,4 +1,3 @@
(ns reagentdemo.intro
(:require [reagent.core :as reagent :refer [atom]]
[reagent.interop :refer-macros [.' .!]]

View File

@ -71,9 +71,8 @@
(let [color @base-color
n @ncolors]
[:div
[:div
[:p "base color: "]
[color-plate (to-rgb color)]]
[:p "base color: "]
[color-plate (to-rgb color)]
[:div.color-samples
[:p n " random matching colors:"]
(map-indexed (fn [k v]

View File

@ -32,14 +32,13 @@
[:p "Fredrik Dyrkell wrote a very nice " [:a lexclock "binary
clock"] " using " [:a om "Om"] ". I thought Id replicate that
using Reagent for fun (another re-write, using " [:a
hoplon "Hoplon"] ", can be seen " [:a hopclock "here"] ")."]
using Reagent for fun (another re-write, using "
[:a hoplon "Hoplon"] ", can be seen " [:a hopclock "here"] ")."]
[:p "So, without further ado, here is a binary clock using Reagent."]
(if summary
[link {:href url
:class 'news-read-mode} "Read more"]
[link {:href url :class 'news-read-mode} "Read more"]
[:div.demo-text
[fn-src (s/syntaxed "(ns example
@ -91,8 +90,8 @@
[fn-src (s/src-of [:main]
"reagentdemo/news/binaryclock.cljs")]
[:p "The entire source is also available " [:a
clocksrc "here"] "."]
[:p "The entire source is also available "
[:a clocksrc "here"] "."]
[:h2 "How it all works"]

View File

@ -172,9 +172,10 @@
_ (assert (util/clj-ifn? render-fun)
(str "Render must be a function, not "
(pr-str render-fun)))
name (or (:displayName fun-map)
(.' render-fun :displayName)
(.' render-fun :name))
name (str (or (:displayName fun-map)
(.' render-fun :displayName)
(.' render-fun :name)
""))
name' (if (empty? name) (str (gensym "reagent")) name)
fmap (-> fun-map
(assoc :displayName name')