Created
March 6, 2018 20:30
-
-
Save hgale/25c32e6d3401522e1e25042d989fc38a 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
const coinAPIBaseURL = 'https://api.coinmarketcap.com'; | |
componentDidMount() { | |
return fetch(`${coinAPIBaseURL}/v1/ticker/?limit=10`) | |
.then(response => response.json()) | |
.then(responseJson => { | |
this.setState({ | |
loading: false, | |
coins: responseJson | |
}) | |
}) | |
.catch(error => { | |
console.error(error); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment