Created
January 23, 2017 21:53
-
-
Save iampava/6fb8cf9ece6ab510387b1f193ba10963 to your computer and use it in GitHub Desktop.
Skydiving through the Promise Land - promise error
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
function takeOff(resolve, reject) { | |
setTimeout(function () { | |
console.log("Whooopsy! Wheater is bad!"); | |
reject(); | |
}, 5000); | |
} | |
function callFriendAndTalkVeryExcitedlyAboutYourPrototype() { | |
console.log("Hey friend, you will not believe what my mind stumbled upon..."); | |
} | |
function getIntoCarAndDriveToAirportASAP() { | |
console.log("Don't cry, I'm coming to you with ice-cream!"); | |
} | |
var promise = new Promise(takeOff); | |
promise.then(callFriendAndTalkVeryExcitedlyAboutYourPrototype, getIntoCarAndDriveToAirportASAP); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment