Last active
February 16, 2019 20:08
-
-
Save keyvan-m-sadeghi/3f1f973bdb3f73d253e68a061db4819a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let p = new Nancy((resolve, reject) => { | |
resolve(42); | |
reject(24); // ignored | |
resolve(); // ignored | |
}); | |
p | |
.then(value => Nancy.reject(value)) // rejects | |
.catch(value => console.log(value)); // logs 42 | |
p = Nancy.reject(Nancy.resolve(42)); | |
// p.state is states.rejected | |
// p.value is a Nancy resolved to 42 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment