map: Don't wait before proceeding if callback returns promise.

This commit is contained in:
David Braun 2017-11-03 12:14:36 -04:00
parent 615f9914ee
commit 4930e4204d
No known key found for this signature in database
GPG key ID: 5694EEC4D129BDCF

View file

@ -160,9 +160,9 @@ const Channel = function(length = 0) {
map: (callbackfn, thisArg) => {
const output = Channel();
(async () => {
await readOnly.forEach(value =>
output.push(callbackfn.call(thisArg, value))
);
await readOnly.forEach(value => {
output.push(callbackfn.call(thisArg, value));
});
output.close();
})();