Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentWillMount () {
console.log('hi im here');
fetch('https://www.cryptonator.com/api/currencies')
.then(function(res) {
if (!res.ok) {
throw Error(res.statusText);
}
return res;
})
.then((res) => res.json())
.then((res)=> {
// https://stackoverflow.com/a/40969739/1580610
this.setState({supported: res.rows});
}
)
}
componentWillMount () {
fetch('https://www.cryptonator.com/api/currencies')
.then(function(res) {
if (!res.ok) {
throw Error(res.statusText);
}
return res;
})
.then((res) => res.json())
.then((res)=> {
// https://stackoverflow.com/a/40969739/1580610
if (this.refs.addRef) {
this.setState({options: res.rows});
}
}
)
}
handleTickerChange = (selected_ticker) => {
const getPages = async location => {
const pages = await fetch(`${SERVER_URL}/page/${location}`, RETRY_OPTIONS);
return await pages.json();
};
export default (url, options) =>
fetchRetry(url, options)
.then(response => {
return log(response);
})
.catch(response => {
return log(response);
});