Skip to content
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

Add Promise.both #55

Closed
anmonteiro opened this issue Jun 8, 2020 · 2 comments
Closed

Add Promise.both #55

anmonteiro opened this issue Jun 8, 2020 · 2 comments

Comments

@anmonteiro
Copy link

This is useful for the and* binding operator.

Currently I'm using:

  let both = (x, y) => {
    Promise.all([x, y])
    ->Promise.map(
        fun
        | [x, y] => (x, y)
        | _ => assert(false),
      );
  };
@aantron
Copy link
Owner

aantron commented Jun 8, 2020

@anmonteiro Promise.all2 should be suitable for this. It was added for #36 and I called it all2 because I didn't think there was a neat set of special names that also covered all3, all4, etc. :) It's mentioned at the end of Concurrent combinations.

@anmonteiro
Copy link
Author

Heh, indeed. Missed it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants