Last active
November 16, 2021 16:18
-
-
Save swannodette/5882703 to your computer and use it in GitHub Desktop.
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!")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah, I see now it's using js/console so the text appears in the chrome dev tools console, not the klipse console.