Created
April 4, 2018 11:26
-
-
Save t9toqwerty/14b49d22e56de44ddb9923f7ccdec49f 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
//Single Promise Object | |
new Promise((resolve, reject) => { | |
// Your Code which you are unsure about execution time duration. | |
resolve();//OR reject(); | |
}) | |
.then(() => { | |
//If resolve() | |
console.log('Do this'); | |
}) | |
.catch(() => { | |
//If Reject | |
console.log('Do that'); | |
}) | |
.then(() => { | |
console.log('Do this whatever happened before'); | |
}); | |
//------------------------------------------------------------------------------- | |
let promise=new Promise((resolve, reject) => { | |
// Your Code which you are unsure about execution time duration. | |
resolve();//OR reject(); | |
}); | |
promise().then(() => { | |
console.log('Resolved'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment