(unique ch)
(unique ch buf-or-n)
Deprecated - this function will be removed. Use transducer instead
Source
(defn
unique
"Deprecated - this function will be removed. Use transducer instead"
([ch] (unique ch nil))
([ch buf-or-n]
(let
[out (chan buf-or-n)]
(go
(loop
[last nil]
(let
[v (<! ch)]
(when
(not (nil? v))
(if (= v last) (recur last) (do (>! out v) (recur v))))))
(close! out))
out)))