Skip to content

Instantly share code, notes, and snippets.

@tonyvu2014
Created June 10, 2018 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyvu2014/1b1b93c8f596e21b920bdbd7d12de226 to your computer and use it in GitHub Desktop.
Save tonyvu2014/1b1b93c8f596e21b920bdbd7d12de226 to your computer and use it in GitHub Desktop.
axios
axios.post(FEED_URL,
{
terms: terms,
limit: LIMIT
},
{ timeout: TIMEOUT }
)
.then(res => {
this.showFeeds(res)
console.log('FeedsScreen - loading feeds is done')
})
.catch(err => {
axios.post(FEED_URL,
{
terms: terms,
limit: LIMIT
},
{ timeout: TIMEOUT }
)
.then(res => {
this.showFeeds(res)
console.log('FeedsScreen - loading feeds is done')
}).catch(err => {
console.log(err)
this.setState({ isLoading:false, hasError: true })
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment