IWatchable

protocolsince v0.0-927Edit
implemented for Atom

Source docstring:
Protocol for types that can be watched. Currently only implemented by Atom.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defprotocol IWatchable
  (-notify-watches [this oldval newval]
    "Calls all watchers with this, oldval and newval.")
  (-add-watch [this key f]
    "Adds a watcher function f to this. Keys must be unique per reference,
     and can be used to remove the watch with -remove-watch.")
  (-remove-watch [this key]
    "Removes watcher that corresponds to key from this."))