                 (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))))))
+      (let [on-view (om/observe owner (tab-on-view))]
+        (if (= (first on-view) :search)
+          (dom/div nil
+                   (dom/h2 nil "library")
+                   (om/build search-entry-view (:term search)
+                             {:init-state {:string ""}})
+                   (om/build results-view (:results search))))))))
+
+(defn show-tab [cursor tab-name]
+  (om/update! cursor [:tab-on-view] [tab-name]))
 
 (defn tab-selector-view [app owner]
   (reify


(defn player-queue []
  (om/ref-cursor (:player-queue (om/root-cursor app-state))))

(defn enqueue-track [track]
  (om/transact! (player-queue) #(conj % track)))

                        (dom/span #js {:className "duration"} "Length")
                        (dom/button #js {:onClick #(dequeue-all)} "-"))
               (map #(om/build queue-track-view
                               %1
                               {:state {:index %2}})
                    queue (range 0 999))
               )))))

