-
Notifications
You must be signed in to change notification settings - Fork 59
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
Support joining Promises of different types #14
Comments
The above is how it's done in, for example, RxSwift. They have a file with functions that allow up to 8 parameters. |
I like your code gen function! In this library, what you call join is called zip. Currently, it only allows two parameters, but we could add higher arity versions. The changes that I'm thinking about making to zip are a) removing the |
How did I manage to miss that? |
This was partially invalid and the rest was implemented in #15. Closing. |
Promise.all
only works with Promises of one type. It would be nice to have similar helpers for Promises of different types, too. I think the only way to accomplish it is to have a separate method for each arity. I didn't know if you're interested in including a set of methods like that, so I decided to start by filing an issue instead of going directly for a PR.I solved it like this:
I generated the three parameter version with this:
So you could use that to generate methods for any arity N ≥ 3, as long as you also had generated ones for 3…N.
Should I file a pull request with something based on this?
The text was updated successfully, but these errors were encountered: