Skip to main content

swap!

functionv1.7

cljs.core/swap!

Available in:BBCLJCLJS
(swap! [a f] [a f x] [a f x y] [a f x y & more])
Atomically swaps the value of atom to be: (apply f current-value-of-atom args). Note that f may be called multiple times, and thus should be free of side effects. Returns the value that was swapped in.

No examples yet. Be the first to add one!