Created
October 6, 2018 16:44
-
-
Save renzocastro/963689cb7164a8647dd2dcf17eda6d24 to your computer and use it in GitHub Desktop.
Js Promise 1
This file contains hidden or 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
const pago = new Promise(function (resolve, reject) { | |
// Esta función se ejecuta al instante | |
setTimeout(() => { | |
// resolve('Resuelto'); | |
reject('Rechazado'); | |
}, 5000); | |
}); | |
const onResolve = data => console.log('RESOLVE', data); | |
const onReject = err => console.log('REJECT', err); | |
pago.then(onResolve, onReject); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment