clojure icon indicating copy to clipboard operation
clojure copied to clipboard

How swap! Works with atoms

Open practicalli-johnny opened this issue 4 years ago • 0 comments

how swap! on atoms work:

get the value of the atom as it is right now compute the new value it will be after applying the function

if the underlying atom's value is still the same as when we started, "commit" the new value to it. If the underlying value has changed, need to rerun the function on the new state

practicalli-johnny avatar Sep 23 '21 16:09 practicalli-johnny