Created
April 8, 2015 16:51
-
-
Save auramo/d4c6f6d174bd174cf335 to your computer and use it in GitHub Desktop.
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 example.core | |
(:require [reagent.core :as reagent :refer [atom]])) | |
(enable-console-print!) | |
(defonce atom1 (atom 1)) | |
(defonce atom2 (atom 2)) | |
(defn handle-file [root stat next] | |
(println "handle file") | |
(reset! output (str @output root "/" (.-name stat) "\n")) | |
(next)) | |
(defn mod-atom-1 [] | |
(swap! atom1 inc @atom1)) | |
(defn mod-atom-2 [] | |
(swap! atom2 inc @atom2)) | |
(defn show-atom1 [] | |
(println "SHOW atom1") | |
[:h1 (str "Atom1: " @atom1)]) | |
(defn show-atom2 [] | |
(println "Show atom2") | |
[:h1 (str "Atom2: " @atom2)]) | |
(defn app [] | |
[:div | |
[:h2 "Atom Shell ClojureScript Tester"] | |
[:button {:name "mod atom1" :on-click mod-atom-1} "Mod atom 1"] | |
[:button {:name "mod atom2" :on-click mod-atom-2} "Mod atom 2"] | |
(show-atom1) | |
(show-atom2)]) | |
(reagent/render [app] (.-body js/document)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment