Skip to content

Instantly share code, notes, and snippets.

@devdays
Created December 10, 2014 21:20
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 devdays/ed3de3c84c02dcb2b0eb to your computer and use it in GitHub Desktop.
Save devdays/ed3de3c84c02dcb2b0eb to your computer and use it in GitHub Desktop.
Object JavaScript - Creating promise in ECMAScript
var promise = new Promise(
function (resolve, reject) { // (A)
// ...
if ( /*...*/ ) {
resolve(value); // success
} else {
reject(reason); // failure
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment