Skip to content

Instantly share code, notes, and snippets.

@rads

rads/core.cljs Secret

Created September 19, 2013 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rads/44b0aa0aaa7f46c5761b to your computer and use it in GitHub Desktop.
Save rads/44b0aa0aaa7f46c5761b to your computer and use it in GitHub Desktop.
(ns dialog.core
(:require [cljs.core.async :as async :refer [<! >! chan timeout]])
(:require-macros [cljs.core.async.macros :refer [go]]))
(let [c (chan)]
(go (while true
(<! c)
(.log js/console "take off channel")))
(go (while true
(<! (timeout 3000))
(>! c true)
(.log js/console "put on channel"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment