(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)
update or replace an atom