Fork me on GitHub
#reagent
<
2020-06-27
>
neural22:06:36

Hello! simple question, i only want the first value of a raton in a button, like this:

neural22:06:39

(defn greet [num] [:div (str "hello " num)]) (defn btn [counter] (let [i @counter] [:div {:on-click #(swap! counter inc)} (str "value-" i)])) (defn doit [] (let [c (r/atom 0)] (fn [] [:div [greet @c] [btn c]])))

neural22:06:05

how i get the very first value of my ratom??