I have the number of atoms in my code, where the general requirement is to update them to a new value, regardless of the current value.
Therefore, I believe that I am writing something like this:
(swap! atom-name (fn [_] (identity new-value)))
This works, but it seems pretty ugly and seems to carry a fine for doing an anonymous closure.
Is there a better way?
source
share