from: Support 'mapfn'.
This commit is contained in:
parent
6b577ea6cd
commit
8088d7e096
3 changed files with 16 additions and 4 deletions
|
@ -306,7 +306,7 @@ const Channel = function(length = 0) {
|
|||
);
|
||||
};
|
||||
|
||||
Channel.from = values => {
|
||||
Channel.from = (values, mapfn, thisArg) => {
|
||||
const channel = Channel();
|
||||
|
||||
(async () => {
|
||||
|
@ -349,7 +349,7 @@ Channel.from = values => {
|
|||
}
|
||||
})();
|
||||
|
||||
return channel;
|
||||
return mapfn ? channel.map(mapfn, thisArg) : channel;
|
||||
};
|
||||
|
||||
Channel.of = (...values) => Channel.from(values);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue