     (when-let [event (<! ch)]
       (cond
         (contains? #{:up :down} event)
-        (let [id (:current-paddle @state)
-              paddle (id @state)]
-          (swap! state assoc id (control! paddle event)))
+        (swap! state (fn [{id :current-paddle :as state}]
+                       (assoc state id (control! (id state) event))))
 
         (contains? #{:paddle-1 :paddle-2} event)
         (swap! state assoc :current-paddle event)

  [id]
  (.getElementById js/document id))

(defn by-tag
  [tag-name]
  (aget (.getElementsByTagName js/document tag-name) 0))

(defn attr!
  [el attr val]
  (aset el attr val)

    (.beginPath ctx)
    (.arc ctx x y radius 0 (* 2 js/Math.PI) false)
    (.fill ctx)
    (.closePath ctx)
    ctx))

(extend-type Rect
  IDrawable
