 
 (defn game-play [{:keys [game-id]}]
   (let [arena (re-frame/subscribe [:game/arena])
-        cmpnt-state (reagent/atom {:resize-fn nil
-                                   :timeout-fn nil})
+        cmpnt-state (reagent/atom {:resize-fn #(on-resize arena)})
         messages (re-frame/subscribe [:game/messages])
         user (re-frame/subscribe [:current-user])
         games (re-frame/subscribe [:games])]

    (set! (.-width canvas-element) dimension)
    (set! (.-height canvas-element) dimension)))

(defn- on-resize [arena-atom cmpnt-state]
  (let [resize-id (:timeout-fn @cmpnt-state)]
    (js/clearTimeout resize-id)
    (let [new-resize-id (js/setTimeout
                                   #(resize-canvas arena-atom)
                                   500)]
      (swap! cmpnt-state assoc :timeout-fn new-resize-id))))

(defn- show-winner-modal
  [winner]


(defn- component-did-mount [arena cmpnt-state]
  ;; Add resize listener
  (let [resize-fn (:resize-fn @cmpnt-state)]
    (.addEventListener js/window
                       "resize"
                       resize-fn))
