Skip to content

Instantly share code, notes, and snippets.

View zeroem's full-sized avatar

Darrell Hamilton zeroem

View GitHub Profile
(ns async-test.timeout.core
(:require [cljs.core.async :refer [chan close!]])
(:require-macros
[cljs.core.async.macros :as m :refer [go]]))
(defn timeout [ms]
(let [c (chan)]
(js/setTimeout (fn [] (close! c)) ms)
c))