Last active
August 29, 2015 14:22
-
-
Save ajcrites/a61445d7f1fbab31eca8 to your computer and use it in GitHub Desktop.
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
var aPromise = Promise.resolve("a promise"); | |
aPromise | |
.then(returnAPromise) | |
.then(returnAValue) | |
.then(returnAPromise) | |
.catch(handleAnyError); | |
function returnAPromise(value) { | |
console.log(value); | |
return Promise.resolve(process.hrtime()); | |
}; | |
function returnAValue(value) { | |
console.log(value); | |
return process.hrtime(); | |
} | |
function handleAnyError(error) { | |
console.log(error); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment