        (fn [e] (put! c e)))
      c))
 
-;; The second function will return a channel only with the events that we care
-;; about, that is, keyup events of the document that happens when an arrow key
-;; is pressed. Also, we would like something more descriptive than a raw DOM
-;; event. We'll take every keyup event of the document, map it to its key code,
-;; stop if they don't belong to an arrow key or map it to either :left, :up,
-;; :right or :down when they do.
+;; While it would be nice to have a channel with only the events that we care
+;; about, that is, keyup events coming just from arrow keys, we would also like
+;; something more descriptive than a raw DOM event. In order to have that,
+;; before putting a keyup event to a channel, we’ll map it to its key code, and
+;; “stop” if they don’t belong to an arrow key. But if they do, we’ll map it to
+;; either :left, :up, :right or :down.
 
 (defn keys-chan
   "Returns a channel of :left, :up, :right and :down events sourced from arrow

;; # Tile synthesis

;; The goal of the game is to merge tiles together until a tile that is not able
;; to be merged appears. Thus, we need to tell if a tile can be merged with
;; another tiles and a mechanism to obtain the result of the merge of two given
;; tiles.


       (sort-by :key)))

;; A Game component will wrap SquareBoard and supply it with the tile sequence
;; it expects from a board and a phase. Remember we want to render new and
;; synthesized tiles on the :reveal phase, but not on :slide. The component will
;; also be responsible for showing a message when the game ends.

(q/defcomponent Game
  [{:keys [board phase]}]
