-
Notifications
You must be signed in to change notification settings - Fork 28
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
Switch any/every/some to arrays instead of varargs #70
Comments
Promise.any(value).then((values) => { });
Promise.any([a, b, c]).then(([a, b, c]) => { }); What if |
@arv I don't understand the question? I wasn't proposing overloading them with both varargs and array; I was proposing only accepting array arguments. (Edited OP to try to make this clearer.) |
I see. Would it throw for non Objects? Would |
I think behaving like the generic array methods would make sense, yeah. It would reject with a |
Back in #16, we ended up talking ourselves into using varargs. After seeing varargs in practice, I am now back in the array camp. Here's the essential reason:
Instead I propose:
There's also the fact that the array methods that
every
andsome
take their name from are, well, array methods, and inextricably associated with arrays in my mind.This is not a big deal in the end, as people can cope with some awkward asymmetry. But I think the parallel between what you pass in to the function vs. what
onFulfilled
gets called with is a good one to preserve, and breaking it makes things unnecessarily awkward. Thus I thought it'd be worth floating a fix to see how people feel.The text was updated successfully, but these errors were encountered: