 (defn queue-track-view [track owner]
   (reify
     om/IRenderState
-    (render-state [this {:keys [dequeue]}]
+    (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 (fn [e] (put! dequeue @track))}
+               (dom/button #js {:onClick #(dequeue-track index)}
                            "-")))))
 
 (defn queue-view [app owner]

               (om/build results-view app {:init-state state})
               (dom/h2 nil "queue")
               (om/build queue-view app {:init-state state})
               (om/build player-view app {:init-state state})
               ))))

(defn init []

                        (dom/button #js {:onClick
                                         (fn [e] (doall (map #(put! dequeue %)
                                                             (:player-queue @app))))}
                                    "-"))
               (map #(om/build queue-track-view
                             %1
                             {:state {:index %2}})
                    queue (range 0 999))
               )))))

(defn query-string-for-map [h]
  (string/join "&"
