Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View async_match.cljs
1 2 3 4 5 6 7 8 9 10 11 12 13 14
(ns async-match.core
(:require-macros [cljs.core.match.macros :refer [match]]
[cljs.core.async.macros :refer [go]])
(:require [cljs.core.match]
[cljs.core.async :refer [<!]]))
(defn foo [in]
(go (while true
(let [[e c] (<! in)]
(match [e]
[{:type :mouse :client-x x :client-y y}] [x y]
[{:type :mouse :page-x x :page-y y}] [x y]
[{:type :touch :page-x x :page-y y}] [x y]
[{:type :key :char-code c}] c)))))