Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
(ns async-test.core
(:require [cljs.core.async :refer [chan]]
[clojure.string :as string])
[cljs.core.async.macros :as m :refer [go alt! alts!]]))
(def c (chan))
(def loc-div (.getElementById js/document "location"))
(.addEventListener js/window "mousemove"
(fn [e]
(>! c [(.-x e) (.-y e)]))))
(while true
(let [loc (<! c)]
(aset loc-div "innerHTML" (string/join ", " loc)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.