Skip to content

Instantly share code, notes, and snippets.

@boxxxie
Last active August 29, 2015 14:11
Show Gist options
  • Save boxxxie/783427920e949eaf70c4 to your computer and use it in GitHub Desktop.
Save boxxxie/783427920e949eaf70c4 to your computer and use it in GitHub Desktop.
(ns chestnut-test2.core
(:require
[cljs.core.async :as async :refer [chan close! <! >! put! timeout alts! to-chan]])
(:require-macros
[cljs.core.async.macros :refer [go go-loop]]))
(def c (to-chan [1 2 3 4])) ;;works
(go (print (<! c))) ;;works
(go (.log js/console (alts! [c]))) ;;error
Uncaught TypeError: Cannot call method 'call' of undefined
core.cljs[eval118] [147] anonymous
core.cljs[eval118] [162] anonymous
core.cljs[eval118] [179] cljs.core.async.impl.dispatch.run.call.state_machine__15034__auto____1
core.cljs[eval118] [196] cljs.core.async.impl.dispatch.run.call.state_machine__15034__auto__
ioc_helpers.js [57] run_state_machine
ioc_helpers.js [59] run_state_machine_wrapped
core.cljs[eval118] [207] anonymous
dispatch.js [16] process_messages
dispatch.js [37] cljs.core.async.impl.dispatch.message_channel.port1.onmessage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment