Created
May 23, 2017 03:24
-
-
Save giancorzo/4bdacb8f58c72197b3ee9196c190aea3 to your computer and use it in GitHub Desktop.
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
var myPromise = new Promise((resolve, reject) => { | |
//Instrucciones que se van a ejecutar | |
if(/* Termino correctamente */) { | |
resolve('Success!'); | |
} else { | |
reject('Failure!'); | |
} | |
}); | |
myPromise.then(function() { | |
/* hacer algo mas cuando la promesa sea resuelta */ | |
}).catch(function() { | |
/* capturar el error */ | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment