promise-chan in ClojureScript does not seem to work. In Clojure on the JVM, the code below produces the expected result.
Example:
(ns hush-vendor-cljs.example(:require-macros [cljs.core.async.macros :refer [go]])(:require [cljs.core.async :refer [promise-chan <! >!]]))
(def p (promise-chan))
(def go-1 (go (let [r (<! p)] (println "got value on promise-chan::" r))))
(def go-2 (go (let [r (<! p)] (println "got value on promise-chan::" r))))
(go (>! p 1));This prints only once in ClojureScript, should be twice. It works on JVM Clojure (prints twice).;=> got value on promise-chan:: 1
Google Chrome 48.0.2564.109 (64-bit) Mac OS X El Capitan 10.11
promise-chan in ClojureScript does not seem to work. In Clojure on the JVM, the code below produces the expected result.
Example:
(ns hush-vendor-cljs.example
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [cljs.core.async :refer [promise-chan <! >!]]))
(def p (promise-chan))
(def go-1 (go (let [r (<! p)] (println "got value on promise-chan::" r))))
(def go-2 (go (let [r (<! p)] (println "got value on promise-chan::" r))))
(go (>! p 1))
;This prints only once in ClojureScript, should be twice. It works on JVM Clojure (prints twice).
;=> got value on promise-chan:: 1