You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!. Im trying to implement a later.setInterval function, and the function is an async call to API (Ajax). Is there any reestriccion? The thing is that the function is executed just once. I change the api function using a 'console.log' function, and worked properly...any comments?
Regards!!
The text was updated successfully, but these errors were encountered:
@evicent It seems like later can work with an async function just fine. The following is a simple example grabbing a random Star Wars character every 5 seconds using later.setInterval
constlater=require('later')constaxios=require('axios')consts=later.parse.text('every 5 seconds')later.setInterval(async()=>{constrandomIndex=Math.ceil(Math.random()*20)const{ data }=awaitaxios.get(`https://swapi.co/api/people/${randomIndex}/`)console.log(data)},s)
Maybe you can provide a simple example on what isn't working properly for you?
Hi!. Im trying to implement a later.setInterval function, and the function is an async call to API (Ajax). Is there any reestriccion? The thing is that the function is executed just once. I change the api function using a 'console.log' function, and worked properly...any comments?
Regards!!
The text was updated successfully, but these errors were encountered: