                      :as app}
                     owner]
   (reify
-    om/IWillMount
-    (will-mount [_]
-      (let [text-chan (or (om/get-state owner :text-chan) (chan))
-            internal-text-chan (chan)
-            throttled (throttle internal-text-chan 250)]
-        (pipe throttled text-chan)
-        (om/set-state! owner :internal-text-chan internal-text-chan)))
     om/IDidUpdate
     (did-update [_ prev-props prev-state]
       (when (and (not= (:highlighted-index prev-props)

                 (> (count ac-results) 0))
        (anim/scroll-into-view (om/get-node owner (:highlighted-index app)) {:pad 30})))
    om/IRenderState
    (render-state [this {:keys [internal-text-chan text]}]
      (dom/form {:class "search"
                 :autoComplete "off"
                 :on-submit #(search-submit (nth ac-results highlighted-index))}

        (when (not (= identity f))
          false)))))

(defn throttle [ms f]
  (let [timer (atom nil)]
    (fn [e]
      (.persist e)
      (js/clearTimeout @timer)
      (reset! timer (js/setTimeout #(f e) ms)))))

(defn quick-search [{:keys [highlighted-index loading? ac-results] :as app} owner]
  (reify
    om/IRenderState
    (render-state [this {:keys [text-chan text]}]
      (dom/form {:class "search" :autoComplete "off"
                 ;; the search widget should prob not need to know about
                 ;; autocomplete results (or act on them)
