(mapConcatD deferred f coll)
maps an async action across a collection and chains the results
onto a deferred
Source
(defn
mapConcatD
"maps an async action across a collection and chains the results\n onto a deferred"
[deferred f coll]
(let
[results (atom [])]
(.then
(reduce
(fn
[defr v]
(liftContD
defr
(fn [_ fin] (f v (fn [v] (swap! results conj v) (fin v))))))
deferred
coll)
(fn [_] (.succeed Deferred @results)))))