function | since v0.0-1236 | clojure.core.reducers/reducer | Edit |
(reducer coll xf)
Given a reducible collection, and a transformation function xf, returns a reducible collection, where any supplied reducing fn will be transformed by xf. xf is a function of reducing fn to reducing fn.
(defn reducer
([coll xf]
(reify
cljs.core/IReduce
(-reduce [this f1]
(-reduce this f1 (f1)))
(-reduce [_ f1 init]
(-reduce coll (xf f1) init)))))