Last active
February 10, 2019 03:23
-
-
Save themichaelyang/b8e799f2f8aa0ad74ae0be73cc8e478c to your computer and use it in GitHub Desktop.
resolves even if rejected out
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
// https://stackoverflow.com/a/31424853/7971276 | |
const reflect = p => p.then(v => ({v, status: "resolved" }), | |
e => ({e, status: "rejected" })); | |
reflect(promise).then((v => { | |
console.log(v.status); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment