mirror of https://github.com/status-im/reagent.git
Rename demoutil
This commit is contained in:
parent
1d48785a42
commit
ce9afb470c
|
@ -4,7 +4,6 @@
|
|||
[reagentdemo.page :as rpage]
|
||||
[reagentdemo.news :as news]
|
||||
[reagentdemo.intro :as intro]
|
||||
[demoutil :as demoutil :refer-macros [get-source]]
|
||||
[reagentdemo.common :as common :refer [demo-component]]
|
||||
[reagent.debug :refer-macros [dbg println]]))
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
(ns reagentdemo.common
|
||||
(:require [reagent.core :as reagent :refer [atom]]
|
||||
[demoutil :as demoutil :refer-macros [get-source]]
|
||||
[reagent.debug :refer-macros [dbg println]]
|
||||
[clojure.string :as string]
|
||||
[reagent.debug :refer-macros [dbg println]]))
|
||||
[reagentdemo.syntax :as syntax]))
|
||||
|
||||
(def syntaxify (memoize demoutil/syntaxify))
|
||||
(def syntaxify (memoize syntax/syntaxify))
|
||||
|
||||
(defn src-parts [src]
|
||||
(string/split src #"\n(?=[(])"))
|
||||
|
@ -31,8 +31,7 @@
|
|||
[:pre (-> funmap (src-for-names defs) syntaxify)])
|
||||
|
||||
(defn demo-component [{:keys [comp src complete]}]
|
||||
(let [colored src
|
||||
showing (atom true)]
|
||||
(let [showing (atom true)]
|
||||
(fn []
|
||||
[:div
|
||||
(when comp
|
||||
|
@ -49,4 +48,4 @@
|
|||
(when @showing
|
||||
[:div.demo-source
|
||||
[:h3.demo-heading "Source"]
|
||||
colored])])))
|
||||
src])])))
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
(:require [reagent.core :as reagent :refer [atom]]
|
||||
[reagent.debug :refer-macros [dbg println]]
|
||||
[clojure.string :as string]
|
||||
[demoutil :as demoutil :refer-macros [get-source]]
|
||||
[reagentdemo.syntax :refer-macros [get-source]]
|
||||
[reagentdemo.common :as common :refer [demo-component]]))
|
||||
|
||||
(defn simple-component []
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
(ns demoutil
|
||||
(ns reagentdemo.syntax
|
||||
(:require [clojure.java.io :as io]))
|
||||
|
||||
(defmacro get-source [srcfile]
|
|
@ -1,4 +1,4 @@
|
|||
(ns demoutil
|
||||
(ns reagentdemo.syntax
|
||||
(:require [clojure.string :as string]))
|
||||
|
||||
(def builtins #{"def" "defn" "ns" "atom" "let" "if" "when"
|
Loading…
Reference in New Issue