This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns clicker2.core | |
(:require [reagent.core :as r])) | |
(def message (r/atom "Hello")) | |
(defn clicker [some-message] | |
(let [john? (r/atom true)] | |
(fn [some-message] | |
(let [clicks (r/atom 0)] | |
(fn [some-message] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns react-tutorial.core | |
(:require | |
[reagent.core :as r])) | |
(defn Square [value click-fn] | |
[:button.square {:on-click click-fn} value]) | |
(defn Board [] | |
(let [squares (r/atom (apply vector (repeat 9 nil))) | |
handle-click #(swap! squares assoc % "X") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns react-tutorial.core | |
(:require | |
[reagent.core :as r])) | |
(defn calculateWinner [squares] | |
(let [lines [[0 1 2] | |
[3 4 5] | |
[6 7 8] | |
[0 3 6] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn Board [squares click-fn] | |
(let [renderSquare (fn [i] | |
[Square (get squares i) #(click-fn i)])] | |
[:div | |
[:div.board-row | |
[renderSquare 0] | |
[renderSquare 1] | |
[renderSquare 2]] | |
[:div.board-row | |
[renderSquare 3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns react-tutorial.core | |
(:require | |
[reagent.core :as r])) | |
(defn calculateWinner [squares] | |
(let [lines [[0 1 2] | |
[3 4 5] | |
[6 7 8] | |
[0 3 6] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns min-css.core | |
(:require | |
[reagent.core :as r])) | |
(defn my-app [] | |
[:div | |
[:h1 "Hello Reagent"] | |
[:p "Some random text in a regular p tag"] | |
[:p.my-class "More random text in a my-class p tag"]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns min-garden.core | |
(:require [garden.core :refer [css]])) | |
(def style | |
[:body {:font-size "16px"}]) | |
(defn -main [] | |
(css {:output-to "resources/public/css/main.css"} | |
style)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns min-garden.core | |
(:require [garden.core :refer [css]])) | |
(def style | |
[:body {:font-size "16px"}]) | |
(defn -main [] | |
(css {:output-to "resources/public/css/main.css"} | |
style)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns min-lein-garden.core | |
(:require [garden.def :refer [defstyles]])) | |
(defstyles style | |
[:body | |
{:font-size "14px" | |
:background "#f00"}]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns figwheel-garden.core | |
(:require | |
[reagent.core :as r])) | |
(defn my-app [] | |
[:div | |
[:h1 "Hello Reagent!"] | |
[:p "Hello Garden!"] | |
[:p.my-class "Hello My-Class!"]]) |