Atom

typesince v0.0-927 clojure.lang/AtomEdit
satisfies IAtom IDeref IEquiv IHash IMeta IPrintWithWriter IWatchable

(Atom. state meta validator watches)

Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(deftype Atom [state meta validator watches]
  Object
  (equiv [this other]
    (-equiv this other))

  IAtom

  IEquiv
  (-equiv [o other] (identical? o other))

  IDeref
  (-deref [_] state)

  IMeta
  (-meta [_] meta)

  IWatchable
  (-notify-watches [this oldval newval]
    (doseq [[key f] watches]
      (f key this oldval newval)))
  (-add-watch [this key f]
    (set! (.-watches this) (assoc watches key f))
    this)
  (-remove-watch [this key]
    (set! (.-watches this) (dissoc watches key)))

  IHash
  (-hash [this] (goog/getUid this)))