map: Return a buffered channel if appropriate.
This commit is contained in:
parent
e8c27056de
commit
4a4a2db7ed
2 changed files with 10 additions and 7 deletions
|
@ -178,7 +178,8 @@ const Channel = function(length = 0) {
|
|||
},
|
||||
|
||||
map: (callbackfn, thisArg) => {
|
||||
const output = Channel();
|
||||
const output = Channel(length);
|
||||
|
||||
(async () => {
|
||||
await readOnly.forEach(value => {
|
||||
output.push(callbackfn.call(thisArg, value));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue