-
-
Save luggage66/19c17f83617b908c6268 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 getSpecialData(arg1) { | |
return someDbCall(arg1) | |
.then((result) => { | |
if (result.isComplete) { | |
return result; | |
} | |
else { | |
return someOtherDbCall(result.foo); | |
} | |
}); | |
} | |
return foo | |
.then(getSpecialData) //this is what I mean by composing. | |
.then(bar); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment