This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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)) | |
(go | |
(<! (timeout 1000)) | |
(.log js/console "Hello") | |
(<! (timeout 1000)) | |
(.log js/console "async") | |
(<! (timeout 1000)) | |
(.log js/console "world!")) |
Ah, I see now it's using js/console so the text appears in the chrome dev tools console, not the klipse console.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
love this one, but when I put it in klipse it just returns
#object[cljs.core.async.impl.channels.ManyToManyChannel]
.