Closed courajs closed 10 years ago
Hey @FellowMD, a single accumulator is the usual signature for a fold (reduce, reduceRight, foldl, foldr, etc.), so I'd like to stick to that for promise.fold
. However, there are a couple of other really nice ways to deal with variadic promises, most notably when.try
and the when.join().spread()
pattern. For example:
var resultPromise = when.try(f, p1, p2, p3);
function f(x, y, z) {
return x+y+z;
}
Closing, as there are other options for handling variadic number of promises. Feel free to continue the discussion, though.
Feels a bit arbitrary to limit promise.fold to folding one arg in. Would it make sense to expand that?