Help Garden

Powered by 🌱Roam Garden

code/my file

  • (ns my-stuff
      (:require
       [reagent.core :as r]))
    
  • (defn my-inc [n]
      (* n 2))
    
  • (defn counter2 [_]
      (let [*count (r/atom 2)]
        (fn [_]
          [:button
           {:on-click (fn [evt] (swap! *count my-inc))}
           @*count])))
    
  • (defn counter [_]
      (let [*count (r/atom 0)]
        (fn [_]
          [:button
           {:on-click (fn [evt] (swap! *count inc))}
           @*count])))
    
roam/render