Created
June 4, 2015 03:40
-
-
Save ajcrites/236f5445eeb4f47d70df 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 = new Promise(function (resolve, reject) { | |
| resolve("a promise"); | |
| }); | |
| aPromise | |
| .then(returnAPromise) | |
| .then(returnAValue) | |
| .then(returnAPromise) | |
| .catch(handleAnyError); | |
| function returnAPromise(value) { | |
| console.log(value); | |
| return new Promise(function (resolve, reject) { | |
| 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