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

Do not run mapping after stop-on-error happened #40

Merged
merged 3 commits into from Jun 27, 2021

Conversation

papb
Copy link
Contributor

@papb papb commented Jun 26, 2021

@papb
Copy link
Contributor Author

papb commented Jun 26, 2021

Note: this PR will cause a conflict with #36 but I can quickly fix the conflict once either of them is merged first.

test.js Outdated
pMap(input, async value => {
mappedValues.push(value);
if (value === 1) {
return delay.reject(100, {value: new Error('Oops!')});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, but this could just await the delay and then throw the error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed! Done: fd0bb09

@sindresorhus sindresorhus merged commit 4b5f9e7 into sindresorhus:main Jun 27, 2021
@papb papb deleted the no-unnecessary-mapping branch June 28, 2021 13:36
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

Successfully merging this pull request may close these issues.

None yet

2 participants