Created
March 3, 2018 23:02
-
-
Save AndrewRayCode/f44c7318c1934324d55373c43465b276 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 { baseUrl } = config; | |
getEndpoints(baseUrl).then(endpoints => { | |
const data = new Array(endpoints.length); | |
// Update the array as endpoints come in | |
endpoints.map((endpoint, index) => { | |
getEndpointData(endpoint, baseUrl).then(response => { | |
data[index] = {endpoint, response}; | |
this.setState({ data }); | |
}); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment