Skip to content

Instantly share code, notes, and snippets.

@patarkf
Created June 10, 2017 18:34
Show Gist options
  • Save patarkf/baa573c34cb8ded74b86c87768854e6f to your computer and use it in GitHub Desktop.
Save patarkf/baa573c34cb8ded74b86c87768854e6f to your computer and use it in GitHub Desktop.
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