Skip to content

Instantly share code, notes, and snippets.

@luislobo14rap
Last active April 16, 2018 21:01
Show Gist options
  • Save luislobo14rap/845855f9da4eb636fe08af8353566ee1 to your computer and use it in GitHub Desktop.
Save luislobo14rap/845855f9da4eb636fe08af8353566ee1 to your computer and use it in GitHub Desktop.
new Promise(function(resolve, reject){
setTimeout(function(){
resolve(true);
}, 5000);
setTimeout(function(){
resolve(false);
}, 10000);
}).then(function(val){
if(val == true){
//...
}else{
console.error('promise error');
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment