             pred (case @filt
                      :active (complement :done)
                      :done :done
-                     :all identity)
-            curedit @editing]
-        (dbg "rendering main")
+                     :all identity)]
+        (dbg "Rendering main")
         [:section#todoapp
          [:header#header
           [:h1 "todos"]

         [:footer#info
          [:p "Double-click to edit a todo"]]]))))

(defn todo-app []
  [todo-main])

(defn ^:export run []
  (cloact/render-component [todo-app] (.-body js/document)))

(defn complete-all [todos v] (swap! todos mod-map map #(assoc-in % [1 :done] v)))
(defn clear-done [todos] (swap! todos mod-map remove #(get-in % [1 :done])))

(defn todo-app [props]
  (let [todos (or (:todos props)
                  (let [t (atom (sorted-map))]
                    (dotimes [x 5]
                      (add-todo t (str "Some todo " x)))
                    t))
        filt (atom :all)]
    (fn []
      (let [items (vals @todos)
            done (->> items (filter :done) count)
