 
   Use for example like this:
 
+  ```cljs
   (wrap (:foo @state)
         swap! state assoc :foo)
+  ```
 
   Probably useful only for passing to child components."
   [value reset-fn & args]


(defn state
  "Returns the state of a component, as set with replace-state or set-state.
  Equivalent to (deref (r/state-atom this))"
  [this]
  (assert-component this)
  (deref (state-atom this)))

(defn replace-state
  "Set state of a component.
  Equivalent to (reset! (state-atom this) new-state)"
  [this new-state]
  (assert-component this)
  (assert-new-state new-state)

;; Utilities

(defn rswap!
  "Swaps the value of a to be `(apply f current-value-of-atom args)`.

  rswap! works like swap!, except that recursive calls to rswap! on
  the same atom are allowed – and it always returns nil."
