Created
June 10, 2017 18:34
-
-
Save patarkf/baa573c34cb8ded74b86c87768854e6f 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
function makeRequest() { | |
return fetch('foo') | |
.then(response => { | |
if (data.doesItNeedAnotherRequest) { | |
return makeAnotherRequest(response) | |
.then(secondResponse => { | |
console.log(secondResponse); | |
return secondResponse; | |
}); | |
} | |
console.log(response); | |
return response; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment