                             :entity 'todo
                             :events ["onBlur" "onChange" "onKeyDown"]}]))
 
-       (rule draw-todo-item
+       (rule draw-todo-input
              (when "todo-to-add" {:value 'cur})
              (pretend "ui/child" {:parent-id "app" :pos 1 :child-id "todo-input"})
              (draw [:input {:id "todo-input"

             (when "todo-displayed" {:todo-id 'todo})
             (when "todo-completed" {:todo-id 'todo :completed? 'complete})
             (func 'active?  "complete == \"completed\" ? \"checked\" : \"\"")
             (func 'child-id "\"todo-checkbox\" + todo")
             (func 'parent-id "\"todo\" + todo")
             (pretend "ui/child" {:parent-id 'parent-id :pos -1 :child-id 'child-id})
             (draw [:input {:id 'child-id
                            :type "checkbox"


(defn fill-todos [env num]
  (dotimes [x num]
    (know env "todo" #js ["todo-id" "text"] #js [x (str "foo" x)])
    (know env "todo-editing" #js ["todo-id" "editing?"] #js [x "saved"])
    (know env "todo-completed" #js ["todo-id" "completed?"] #js [x "active"]))
  )

(defn click! [env elem]
  (.assoc! (index env "ui/onClick") #js[elem] 0))
