Created
October 2, 2020 12:45
-
-
Save nsacerdote/e6ff2586941bf605ca9ad835476c9a20 to your computer and use it in GitHub Desktop.
This file contains 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 doSomething() { | |
const results = {}; | |
return performStep1() | |
.then(result1 => (results.one = result1)) | |
.then(() => performStep2(results.one)) | |
.then(result2 => (results.two = result2)) | |
.then(() => performStep3(results.two)) | |
.then(result3 => performFinalStep(results.one, result3)) | |
.then(finalResult => ({ | |
result2: results.two, | |
finalResult, | |
})); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment