                                  })
                  )))))
 
+(defn search-view [search owner]
+  (reify
+    om/IWillMount
+    (will-mount [_]
+      (let [channel (om/get-shared owner :search-channel)]
+        (go (loop []
+              (let [search-for (merge (:term @search) (<! channel))
+                    _ (om/update! search [:term] search-for)
+                    tracks (<! (xhr-search search-for))
+                    sorted (sorted-tracks tracks)]
+                (om/update! search [:results] (vec sorted))
+                (recur))))))
+    om/IRender
+    (render [this]
+      (dom/div nil
+               (om/build search-entry-view (:term search)
+                         {:init-state {:string ""}})
+               (dom/h2 nil "results")
+               (om/build results-view (:results search))))))
+
 (defn app-view [app owner]
   (reify
     om/IRender
     (render [this]
       (dom/div nil
-               (om/build filters-view app
-                         {:init-state {:search-term ""}})
-               (dom/h2 nil "results")
-               (om/build results-view (:results app))
+               (om/build search-view (:search app))
                (dom/h2 nil "queue")
                (om/build queue-view app)
                (om/build player-view app)



(defn xhr-search [term]
  (let [channel (chan)]
    (.send XhrIo "/tracks.json"
           (fn [e]
             (let [xhr (.-target e)

               )))))


(defn search-entry-view [term owner]
  (reify
    om/IRenderState
    (render-state [this state]
      (let [search-chan (om/get-shared owner :search-channel)
            send-search (fn [e]
                          (let [str (.. e -target -value)]
                            (om/update! term [:_content] str)
                            (put! search-chan {:_content str})))]
        (dom/div nil
                 (dom/h1
                  #js {:id "sledge"}
