diff --git a/codemirror.html b/codemirror.html index 371548e..ba668c7 100644 --- a/codemirror.html +++ b/codemirror.html @@ -1,11 +1,11 @@
- + - + - + + + + - + - - + + + @@ -20,14 +21,26 @@ (def state (r/atom {:clicks 0})) + #_(require '[re-frame.core :as rf] + '[reagent.dom :as rdom]) + #_(rf/reg-event-fx ::click (fn [{:keys [db]} [_]] {:db (update db :clicks (fnil inc 0))})) + #_(rf/reg-sub ::clicks (fn [db _] (:clicks db))) + (defn my-component [] [:div [:p "Clicks: " (:clicks @state)] - [:p [:button {:on-click #(swap! state update :clicks inc)} + [:p [:button {:on-click #(do (swap! state update :clicks inc) + #_(rf/dispatch [::click]))} "Click me!"]]]) + #_(defn re-frame-component [] + (let [clicks (rf/subscribe [::clicks])] + [:div "Clicks:" @clicks])) + (rdom/render [my-component] (.getElementById js/document "app")) + #_(rdom/render [re-frame-component] (.getElementById js/document "re-frame")) + (require '[ajax.core :refer [GET]]) (defn handler [response] @@ -74,7 +87,7 @@ To embed scittle in your website, it is recommended to use the links published to - the releases + the releases page. Include scittle.js and write a script tag @@ -108,6 +121,13 @@ + + +