-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement map() #3
Comments
Hm... I noticed that you removed the |
Hi, It was removed because I wasn't satisfied with its features and API. What features were you using that is not available via a simple await Promise.all(Array.from(iterable, async item => {
// …
})) |
Well, I had code that looked like this: return Promise.all([manager.getAllUserIds(), getUserIds(processId)])
.then(apply(difference))
::map(disconnecter.disconnect(?, 0)); Using return Promise.all([manager.getAllUserIds(), getUserIds(processId)])
.then(apply(difference))
.then(ids => Promise.all(ids.map(disconnecter.disconnect(?, 0)))); Not the end of the world but I really like the syntax with |
I like this syntax as well, unfortunately it looks like it's never gonna be standardized, therefore I'll be moving away from it. If you want to keep using it, you can use a simple implementation like: function map(cb) {
return Promise.all(Array.from(this, cb));
} |
Well, more recently there has been some progress as far as this proposal goes: https://github.com/tc39/proposal-extensions |
Thanks for this info, I'll keep an eye on it 🙂 |
iterable
promise to be resolvedmapper
on an entry ASAPconcurrency
option defaulting toInfinity
The text was updated successfully, but these errors were encountered: