 ;;-----------------------------------------------------------------------------
 
 (defn resize!
-  [ctx e]
+  [ctx]
   (let [w (- (.-innerWidth js/window) 40)
         h (- (int (/ (* w 9) 16)) 40)]
     (-> (by-id "canvas")

  (let [ctx (.getContext (by-id "canvas") "2d")
        events (chan 1 control-stream)]
    (event-loop! state events)
    (listen! js/window "resize" (partial resize! ctx))
    (listen! js/document "keydown" #(put! events (.-keyCode %)))
    (resize! ctx nil)
    (animate! ctx)))

(set! (.-onload js/window) main)

    (when-let [event (<! ch)]
      (cond
        (contains? #{:up :down} 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)
