What is the difference between using swap!
and reset!
in Clojure functions? I saw from clojure.core docs that they are used to change the value of an atom, but I'm not sure when to use swap!
and when to use reset!
.
In what circumstances would you use swap!
and what circumstances would you use reset!
?
[:input {:type "text" :value @time-color :on-change
The above code is an example of using reset!
for button
[:input.form-control {:type :text :name :ric :on-change
And this button uses swap!
Are swap!
and reset!
interchangeable?
thanks
source share