   (:require-macros [cljs.core.async.macros :refer [go]]))
 
 (defonce app-setup
+
   (do
     (enable-console-print!)))
 
 (defonce app-state (atom {:bpm {} 
-                          :meter {:count 0}
-                          :should-stop false}))
+                          :meter {:count 0}}))
 
 (defn clock [bpm owner]
   (letfn [(start-interval [millis] 
             (om/update! bpm :interval millis)
             (om/update! bpm :next-beat nil))
           (stop-interval []
-            (.log js/console "lol")
             (om/update! bpm :interval nil))]
     (reify
       om/IInitState

                             (om/update! bpm :next-beat (+ t interval))))))
                     (when (om/get-state owner :mounted)
                       (.requestAnimationFrame js/window cb))))
                 (let [click-channel (om/get-state owner :click-channel)]
                   (go (loop []
                         (let [new-interval-millis (<! click-channel)]
                           (if (false? new-interval-millis)
                             (stop-interval)
                             (start-interval new-interval-millis))

                 (dot 3)
                 (dot 0))))))

(om/root
 (fn [app owner]
   (reify
     om/IInitState
     (init-state [_] {:sound-channel (chan)
                      :tempo-channel (chan)})
     om/IRenderState
     (render-state
      [_ {:keys [sound-channel tempo-channel]}]
      (dom/div nil
               (dom/h1 nil "metronome")
               (om/build clock (:bpm app) {:init-state {:sound-channel sound-channel :tempo-channel tempo-channel}})
               (om/build sound (:meter app) {:init-state {:sound-channel sound-channel}})
               (om/build tap-tempo-button nil {:init-state {:tempo-channel tempo-channel}})
               (om/build dots (:meter app))))))
 app-state
 {:target (. js/document (getElementById "app"))})
