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

fixed issue #81 - only reject OR resolve promise (not both) #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matmar10
Copy link

@matmar10 matmar10 commented Apr 5, 2020

No description provided.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 98.011% when pulling fd6e3dd on matmar10:issue-81-duplicate-resolution-of-promises into ae6ad3f on straker:master.

@matmar10 matmar10 marked this pull request as ready for review April 5, 2020 07:40
const promises = [];
files.forEach(function(data) {
const result = callback.apply(null, data);
if ('object' === typeof result && result.then) {
Copy link
Owner

Choose a reason for hiding this comment

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

Interesting. How are you using the callback function in this case? I'm curious what the returned Promise is doing.

Copy link
Owner

Choose a reason for hiding this comment

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

Also, wouldn't it be easier to ask if it was Promise? if (result instanceof Promise)

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

3 participants