 (defn fetch-server-time [ cb ]
   (ajax-get "/server-time" cb))
 
+(defn fetch-latest-series-data [ series-name cb ]
+  (ajax-get (str "/latest/" series-name) cb))
+
 (defn series-pane [ state owner ]
-  (om/component
-   (dom/div nil state)))
-
-(defn series-list [ state owner ]
   (reify
     om/IWillMount
     (will-mount [ this ]
-      (go
-        (om/update! state :series-names (<! (<<< fetch-series-names)))))
+      (js/setInterval
+       (fn []
+         (go
+           (let [ resp (<! (<<< fetch-latest-series-data (:name state)))]
+             (om/update! state :val (:val resp)))))
+       15000))
+    
+    om/IRender
+    (render [ this ]
+      (dom/div nil (:name state) " - " (:val state)))))
 
+(defn series-list [ state owner ]
+  (reify    
     om/IRender
     (render [ this ]
       (apply dom/div nil
-             (map #(om/build series-pane %)
-                  (:series-names state))))))
+             (om/build-all series-pane (:series state))))))
 
 (defn server-time [ state owner ]
   (reify

(om/root dashboard dashboard-state
  {:target (. js/document (getElementById "metlog"))})


            [cljs.core.async :refer [put! close! chan <!]]))

(def dashboard-state (atom {:server-time nil
                            :series []}))

(defn <<< [f & args]
  (let [c (chan)]
