core.cljs 667 B

1234567891011121314151617181920212223
  1. (ns automata.core
  2. (:require [reagent.core :as reagent :refer [atom]]))
  3. (enable-console-print!)
  4. (println "This text is printed from src/automata/core.cljs. Go ahead and edit it and see reloading in action.")
  5. ;; define your app data so that it doesn't get over-written on reload
  6. (defonce app-state (atom {:text "Hello world!"}))
  7. (defn hello-world []
  8. [:h1 (:text @app-state)])
  9. (reagent/render-component [hello-world]
  10. (. js/document (getElementById "app")))
  11. (defn on-js-reload []
  12. ;; optionally touch your app-state to force rerendering depending on
  13. ;; your application
  14. ;; (swap! app-state update-in [:__figwheel_counter] inc)
  15. )