 ;; =============================================================================
 ;; Helpers
 
-(defn add-item [item owner {:keys [event current-item]}]
+(defn add-item [item owner {:keys [event navigate]}]
   (let [new-text (-> (om/get-node owner "new-item-text")
                      .-value)
         new-title (-> (om/get-node owner "new-item-title")
                       .-value)]
     (when (and new-title new-text)
       (put! event {:op :create
-                  :data {:item/title new-title :item/text new-text}}))))
+                   :data {:item/title new-title :item/text new-text}}))))
 
 (defn handle-item-text-change [e owner {:keys [text]}]
   (let [value (.. e -target -value)


      ;; routing loop
      (go (loop []
            (let [id (<! (om/get-state owner :current-item))]
              (cond
               (= id :new)
               (do

                                {:url (str "/search/" (:subs data))}))]
                  ;; XXX: what if there's no hit?
                  ;;(.setToken history (str "/items")) ;; XXX
                  (om/transact! app :items (fn [_] data))
                  )
                
                (recur))))))
    
    om/IRenderState
    (render-state [_ {:keys [navigate event]}]
      (let [route (:route app)
            opts {:opts {:navigate navigate
                         :event event}}]
        ;; menu bar
        (dom/div nil
