I'm trying to call api every 30 seconds. I already tried to do it with setInterval but it did not really work out.
Any suggestions?
componentDidMount() {
const {getCurrencies, setPageCount,loadData} = this.props.actions
agent
.get('https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?CMC_PRO_API_KEY=XXX')
.then(res => {
getCurrencies(res.body.data)
setPageCount()
})
.catch(err => {
console.log(err)
});
}