Closed lgrapenthin closed 5 years ago
example from #4 in cljs
Unlike the CLJ version, this version yields a result. I. e. it prints
res [0 1 2]
But shortly after that, an uncaught type error is thrown in impl.cljs
(defn process-producer [event-fn] (let [step (fn step [i] (if (= 5 i) nil (js/setTimeout (fn [] (event-fn i) (step (inc i))) 1000)))] (step 0) (fn [] (.log js/console "Process producer cancelled")))) (defn printer [t] (t (fn [res] (println "res" res)) (fn [err] (println "err" err)))) (def inst (printer (->> (m/observe process-producer) (m/transform (take 3)) (m/aggregate conj))))
Bug. It should not really happen because unsubscription is supposed to prevent the event callback from being called again, but if it happens anyhow the callback should return normally.
example from #4 in cljs
Unlike the CLJ version, this version yields a result. I. e. it prints
But shortly after that, an uncaught type error is thrown in impl.cljs