                         (dom/button #js {:onClick
                                          (fn [e] (doall (map #(put! dequeue %)
                                                              (:player-queue @app))))}
-                                  "-"))
-               (om/build-all queue-track-view
-                             queue
-                             {:init-state {:dequeue dequeue}})
-             )))))
+                                    "-"))
+               (map #(om/build queue-track-view
+                             %1
+                             {:state {:index %2}})
+                    queue (range 0 999))
+               )))))
 
 (defn query-string-for-map [h]
   (string/join "&"


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

(defn mmss [seconds]
  (let [m (quot seconds 60)

(defn queue-track-view [track owner]
  (reify
    om/IRenderState
    (render-state [this {:keys [index]}]
      (dom/div #js {:className "track"}
               (dom/span #js {:className "artist"} (get track "artist"))
               (dom/span #js {:className "album"} (get track "album" ))
               (dom/span #js {:className "title"} (get track "title"))
               (dom/span #js {:className "duration"} (mmss (get track "length")))
               (dom/button #js {:onClick #(dequeue-track index)}
                           "-")))))

(defn queue-view [app owner]
