 
 (enable-console-print!)
 
-(def app-state {:counters [{:count 0 :id 0} {:count 1 :id 1}]})
+(def app-state (->> (range 0 1000)
+                    (map #(assoc {:count 1} :id %))
+                    vec
+                    (assoc {} :counters)))
+
+(println app-state)
 
 (defn get-counters [state key]
   (let [st @state]

  Object
  (render [this]
          (let [{:keys [count id] :as props} (om/props this)]
            (dom/div nil
                     (dom/span nil (str "Count: " count " id: " id))
                     (dom/button
                      #js {:onClick
                           (fn [e] (om/transact! this `[(counter/increment ~props) :count]))}
                      "Click me!")))))
(def counter-view (om/factory Counter {:keyfn :id}))

(defui MyRoot
  static om/IQuery

           [{:counters subquery}]))
  Object
  (render [this]
          (println "rendering root" (om/props this))
          (let [{:keys [counters]} (om/props this)]
            (dom/div nil
                     (total-view counters)
                     (dom/div nil
                              (map counter-view counters))))))

