Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@RusAlex
Created March 14, 2017 06:46
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 RusAlex/95de30da6e22a36f52cf4fc71417d907 to your computer and use it in GitHub Desktop.
Save RusAlex/95de30da6e22a36f52cf4fc71417d907 to your computer and use it in GitHub Desktop.
var p1 = new Promise(function(resolve, reject) {
console.log('resolving');
resolve('Success!');
});
setTimeout(() => {
p1.then(function(value) {
console.log(value); // Success!
}, function(reason) {
console.log(reason); // Error!
});
},
10000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment