Skip to content

Conversation

@oriweingart
Copy link
Collaborator

support chained rejected promises

@lirown
Copy link
Owner

lirown commented Jun 20, 2018

2 spaces instead of 4

@coveralls
Copy link

coveralls commented Jun 20, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 978e838 on oriw-support-rejected-promises into 05934ef on master.

src/custom.js Outdated
}

let defer = resolveWithDirective(() => Promise.resolve(resolve(source, args, context, info)), source, directive, context, info);
defer.catch(e=> {resolveWithDirective(() => Promise.reject(e), source, directive, context, info)})
Copy link
Owner

@lirown lirown Jun 20, 2018

Choose a reason for hiding this comment

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

defer.catch(e => resolveWithDirective(() => Promise.reject(e), source, directive, context, info))```

src/custom.js Outdated

for (let directiveNext of directives.slice(1)) {
defer = defer.then(result => resolveWithDirective(() => Promise.resolve(result), source, directiveNext, context, info));
defer.catch(e=> resolveWithDirective(() => Promise.reject(e), source, directiveNext, context, info)});
Copy link
Owner

Choose a reason for hiding this comment

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

defer.catch(e => resolveWithDirective(() => Promise.reject(e), source, directiveNext, context, info)})

@lirown lirown merged commit 5fa523a into master Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants