           (let [[v _] (alts! [c-touchstart c-touchmove c-touchend (timeout wait)])]
             (if (nil? v)
               (recur (<! (touch-tick touches out-c)))
-              (recur (<! (handle-touch v touches out-c)))))))
+              (recur (<! (handle-touches v touches out-c)))))))
     out-c))
 
 (defn step-time

                  (> (.abs js/Math (- (-> prev-t :position :y) (-> cur-t :position :y)))
                     10))))))

(defmulti handle-touch (fn [t touches out-c] (:type t)))

(defmethod handle-touch "touchstart"
  [{touch-id :touch-id :as t} touches out-c]
  (go
   (assoc touches touch-id t)))

(defmethod handle-touch "touchmove"
  [{touch-id :touch-id :as t} touches out-c]
  (go
   (if (scrolling-touch? touches t)
     (let [{{x1 :x y1 :y} :position} (get touches touch-id)
           {{x2 :x y2 :y} :position} t
           scroll (-> t (assoc :x-distance (- x1 x2)) (assoc :y-distance (- y1 y2)))]
       (>! out-c scroll)
       (assoc touches touch-id scroll))
     touches)))

(defmethod handle-touch "touchend"
  [{touch-id :touch-id :as t} touches out-c]
  (go
   (assoc touches touch-id t)))

(defn emit-touch?
  [{t-type :type t-ticks :ticks} touches]


(defn touches
  [canvas-id type]
  (map< touch-data->touches (util/listen (dom/getElement canvas-id) type)))

(defn scrolling-touch?
  [touches cur-t]
