Refactor join
.
This commit is contained in:
parent
3d17e23338
commit
43b09b0c58
1 changed files with 1 additions and 9 deletions
10
lib/index.js
10
lib/index.js
|
@ -186,15 +186,7 @@ const Channel = function(length = 0) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
join: async separator => {
|
join: async separator => (await readOnly.values()).join(separator),
|
||||||
const elements = [];
|
|
||||||
|
|
||||||
await readOnly.forEach(element => {
|
|
||||||
elements.push(element);
|
|
||||||
});
|
|
||||||
|
|
||||||
return elements.join(separator);
|
|
||||||
},
|
|
||||||
|
|
||||||
map: (callbackfn, thisArg) => {
|
map: (callbackfn, thisArg) => {
|
||||||
const output = Channel();
|
const output = Channel();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue