   (letfn
     [(create [_]
        (om/transact! data [:counters]
-                     #(conj % {:id (-> % last :id inc) :value "grrr"})))]
+                     #(conj % {:id (-> % last :id inc)
+                               :value (apply str (repeat (inc (rand-int 5)) "g"))})))]
     (reify
       om/IRender
       (render [_]

  (patch [this edit]
    (println "You done goofed!")
    (println (pr-str this))
    (println (pr-str edit))))

(defn x-ray
  [data owner]

                        {:key :id
                         :opts {:parent-data (get data :counters)}}))))))

(def app-state {:counters (mapv (fn [n] {:id n
                                         :value (apply str (repeat n "f"))})
                                (range 10))})

(def !app-state (atom app-state))
(def !composed (atom {}))
(def concurrent {[:counters] [[:delete 5] [:retain 5]]
                 [:counters 0 :value] [[:retain 5] [:insert "hey!"]]
                 [:counters 4 :value] [[:retain 9]]})

(defn tx-listener
  [{:keys [path old-value new-value old-state new-state]}]
  (let [edit-map {path (transom/diff old-value new-value)}
        new-state' (transom/patch old-state edit-map)]
    (swap! !composed #(transom/compose old-state % edit-map))
    (let [composed @!composed
          new-state'' (transom/patch app-state composed)]
      (assert (= new-state new-state' new-state'')
              (str \newline (pr-str new-state)
                   \newline (pr-str new-state')
                   \newline (pr-str new-state'')))
      (let [[concurrent' composed'] (transom/transform app-state concurrent composed)]
        (println concurrent' composed')
        (assert (= (transom/patch app-state composed concurrent')
                   (transom/patch app-state concurrent composed'))
                (str \newline (pr-str composed)
                     \newline (pr-str concurrent)
                     \newline (pr-str composed')
                     \newline (pr-str concurrent')))))))

(om/root
  counter-view
