Skip to content

Instantly share code, notes, and snippets.

@mdshadman
Last active October 24, 2019 18:24
Show Gist options
  • Save mdshadman/7d0a3443b297a3b6a69a50b4bf97280f to your computer and use it in GitHub Desktop.
Save mdshadman/7d0a3443b297a3b6a69a50b4bf97280f to your computer and use it in GitHub Desktop.
goForAxios = () => {
this.setState({
fromFetch: false,
loading: true,
})
axios.get("https://jsonplaceholder.typicode.com/users")
.then(response => {
console.log('getting data from axios', response.data);
setTimeout(() => {
this.setState({
loading: false,
axiosData: response.data
})
}, 2000)
})
.catch(error => {
console.log(error);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment