2 ms·
So, you are saying that this : (ns example (:require [reagent.core :as r])) (def click-count (r/atom 0)) (defn counting-component []
by jcelerier 7y ago
So, you are saying that this :
(ns example
(:require [reagent.core :as r]))
(def click-count (r/atom 0))
(defn counting-component []
[:div
"The atom " [:code "click-count"] " has value: "
@click-count ". "
[:input {:type "button" :value "Click me!"
:on-click #(swap! click-count inc)}]])
Is better than this :
import QtQuick.Controls 2.3
Button {
property int count: 0
onClicked: count++
text: count == 0
? "Click me!"
: "The value is : " + count
}
? (testable here : https://tinyurl.com/rjgcfod https://tinyurl.com/rjgcfod)