Skip to content

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

Merged
sindresorhus merged 3 commits into
sindresorhus:mainfrom
papb:no-unnecessary-mapping
Jun 27, 2021
Merged

Do not run mapping after stop-on-error happened#40
sindresorhus merged 3 commits into
sindresorhus:mainfrom
papb:no-unnecessary-mapping

Conversation

@papb

@papb papb commented Jun 26, 2021

Copy link
Copy Markdown
Contributor

@papb

papb commented Jun 26, 2021

Copy link
Copy Markdown
Contributor Author

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

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

Copy link
Copy Markdown
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
Copy Markdown
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

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.

2 participants