Skip to content

Instantly share code, notes, and snippets.

@s-ashwinkumar
Last active August 4, 2017 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s-ashwinkumar/0df30e4d78d0caebfe0701fe4177780b to your computer and use it in GitHub Desktop.
Save s-ashwinkumar/0df30e4d78d0caebfe0701fe4177780b to your computer and use it in GitHub Desktop.
Sample first promise
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