Last active
August 4, 2017 08:34
-
-
Save s-ashwinkumar/0df30e4d78d0caebfe0701fe4177780b to your computer and use it in GitHub Desktop.
Sample first promise
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 iReturnEarly = true; | |
const willAddNewPost = new Promise( | |
(resolve, reject) => { | |
if(iReturnEarly) { | |
resolve("This is new post"); | |
}else { | |
reject("Damn I missed it."); | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment