Skip to content

Instantly share code, notes, and snippets.

@stayradiated
Created October 26, 2016 01:54
Show Gist options
  • Save stayradiated/789dfdc1cf7fa405808dffcfd97c033b to your computer and use it in GitHub Desktop.
Save stayradiated/789dfdc1cf7fa405808dffcfd97c033b to your computer and use it in GitHub Desktop.
var successPromise = new Promise(function (resolve, reject) {
setTimeout(resolve, 1000);
});
successPromise.then(function () { console.log('this should succeed') });
var failingPromise = new Promise(function (resolve, reject) {
setTimeout(reject, 1000);
});
failingPromise.catch(function () { console.log('this should fail') });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment