remove-watch

added
1.0

ns
clojure.core

type
function

(remove-watch reference key)

Removes a watch (set by add-watch) from a reference

                (def a (atom nil))

;; The key of the watch is `:logger`
(add-watch a :logger #(println %4))

(reset! a [1 2 3])

;; Deactivate the watch by its assigned key
(remove-watch a :logger)