You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How would this even work? Reduce depends on the last value. If it doesn't, then why do you need reduce?
One potential use-case would be when the values can be determined asynchronously and independent from each other. Currently this can mostly be archived with pMapIterable, however, that requires a for loop and thus cannot easily be used in e.g. an expression.
Or in other words: pReduce should be able to accept not only Iterable<Promise|any> but also AsyncIterator<any>. This way one could write pReduce(pMapIterable(values, mapper), reducer, initialVal)
Similar to
p-map
, it would be nice to have this built-in rather than have to usep-limit
for instance.The text was updated successfully, but these errors were encountered: