             [ajax.core :refer [GET POST]]))
 
 (def state (r/atom {:server "http://localhost:8080"
-                    :playlist []}))
+                    :playlist []
+                    :tracks []}))
 
 (defn update-state! [k value]
   (swap! state assoc k value))

(defn get-playlist []
  (GET "http://localhost:8080/api/queue"
       {:handler #(update-state! :playlist (% "items"))
        :response-format :json}))

;; -------------------------

   [:ul (for [track (@state :playlist)]
          [:li (track-span track)])]])

(defn tracks-div []
  (js/setTimeout get-tracks 1000)
  [:div [:h2 "Tracks"]
   [:ul (for [track (@state :tracks)]
          [:li (track-span track)])]])

(defn home-page []
  [:div [:h1 "Airhead"]
   [server-form]
   [playlist-div]
   [tracks-div]])

;; -------------------------
;; Initialize app
