mirror of https://github.com/status-im/reagent.git
Cleanup and fix for ClojureScript 0.0-2411
This commit is contained in:
parent
fc2c59c3e1
commit
59b2e6d6ee
|
@ -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)]
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
(ns reagentdemo.intro
|
||||
(:require [reagent.core :as reagent :refer [atom]]
|
||||
[reagent.interop :refer-macros [.' .!]]
|
||||
|
|
|
@ -70,10 +70,9 @@
|
|||
(defn palette []
|
||||
(let [color @base-color
|
||||
n @ncolors]
|
||||
[:div
|
||||
[:div
|
||||
[:p "base color: "]
|
||||
[color-plate (to-rgb color)]]
|
||||
[color-plate (to-rgb color)]
|
||||
[:div.color-samples
|
||||
[:p n " random matching colors:"]
|
||||
(map-indexed (fn [k v]
|
||||
|
|
|
@ -32,14 +32,13 @@
|
|||
|
||||
[:p "Fredrik Dyrkell wrote a very nice " [:a lexclock "binary
|
||||
clock"] " using " [:a om "Om"] ". I thought I’d 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"]
|
||||
|
||||
|
|
|
@ -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)
|
||||
name (str (or (:displayName fun-map)
|
||||
(.' render-fun :displayName)
|
||||
(.' render-fun :name))
|
||||
(.' render-fun :name)
|
||||
""))
|
||||
name' (if (empty? name) (str (gensym "reagent")) name)
|
||||
fmap (-> fun-map
|
||||
(assoc :displayName name')
|
||||
|
|
Loading…
Reference in New Issue