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

Adding concurrent function that works like Promise.allSettled #182

Open
shine1594 opened this issue Dec 7, 2022 · 1 comment
Open

Adding concurrent function that works like Promise.allSettled #182

shine1594 opened this issue Dec 7, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@shine1594
Copy link
Collaborator

Suggestion

⭐ Suggestion

💻 Use Cases

await  pipe(
  range(1, 10),
  someAsyncTask, // Assume `ReturnType<typeof someAsyncTask>` is `T`
  concurrent(5, 'allSettled') // OR concurrent.allSettled(5),
  filter((a): a is PromiseFulfilledResult<T> => a.status === 'fulfilled'),
  each(({ value }) => { console.log(value); })
);
@ppeeou
Copy link
Member

ppeeou commented Dec 20, 2022

Good suggestion! How about concurrentAllSettled?

@ppeeou ppeeou added the enhancement New feature or request label Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants