Created
November 5, 2021 11:27
-
-
Save snigo/610564a5d7fec1cb91fdc883979a7220 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
const API_URL = 'https://mysuperduperapp.com/api'; | |
function parseResponse(response) { | |
/** React on response event */ | |
return response.json(); | |
} | |
function handleResponse(data) { | |
/** React on successful parsing (job done) event */ | |
} | |
fetch(API_URL) | |
.then(parseResponse) | |
.then(handleResponse); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment