Values & References10 / 14
Up next

swap! and reset!

(def state (atom {:count 0}))
;; swap! applies a function to the current value
(swap! state update :count + 5)
(println @state)
;; reset! replaces the value outright
(reset! state {:count 0})
(println @state)
What you're solving

update or replace an atom