Skip to content

Instantly share code, notes, and snippets.

@mark0978
Last active February 21, 2019 15:34
Show Gist options
  • Save mark0978/2193809010fd027077d6985f6b4d2776 to your computer and use it in GitHub Desktop.
Save mark0978/2193809010fd027077d6985f6b4d2776 to your computer and use it in GitHub Desktop.
Async fetching of author data before caching
fetchAuthor =(url) =>{
fetch(url)
.then(res => res.json())
.then((response) =>{
this.setState({
author:response
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment