To-chan onto-change deprecated, then what?

I saw them on API docs and wanted to try the feature. But I was told these API have been deprecated,


Are there any replacements?

Also I found onto-chan was used in combination of transducers, according to

(defn square [x] (* x x))

(def xform
    (filter even?)
    (filter #(< % 10))
    (map square)
    (map inc)))

(def c (async/chan 1 xform))

  (async/onto-chan c [5 6 8 12 15]))
(loop [n (async/<!! c)]
  (when n
    (println n)
    (recur (async/<!! c))))

If onto-chan has been deprecated, then how do I use transdusers with core.async ?

Use onto-chan!. Same behaviour.

This change is driven by implementation on clojure side where onto-chan!! is added so onto-chan is renamed to onto-chan!.

1 Like