Open tshemsedinov opened 6 years ago
@tshemsedinov current implementation of metasync.map
has such contract:
metasync.map(array, (value, callback) => callback(err, result), done);
As I understand we should change it to:
metasync.map(array, (value, [index[, array]], callback) => callback(err, result), done);
Or we may also add optional thisArg
to contract, so this will look like this:
metasync.map(array, (value, [index[, array]], callback) => callback(err, result) [, thisArg], done);
@tshemsedinov I'd prefer to leave it as it is, but we should use Iterators instead of Arrays, so that any Iterable object may be passed to metasync.map
and other functions (#313).
On the other hand, we can create metasync.Iterator
for such use-cases.
WDYT?
Compare
and current implementation:
we may change to: