Created
June 10, 2018 08:10
-
-
Save tonyvu2014/1b1b93c8f596e21b920bdbd7d12de226 to your computer and use it in GitHub Desktop.
axios
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
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