I have serious doubts about this that came to me recently.
I want to make an infinite loop of a request to an API every 15 seconds, but I want the loop to wait for the answer of the promise and then go again 15 seconds.
So, the behavior I'm looking for is something like this:
Request -> (Tiempo aleatorio) -> Repuesta -> (Espera 15 seg)
-> Request (Comenzando el ciclo nuevamente).
And what I get is ...
Request -> (Tiempo aleatorio) -> Repuesta -> (Espera 15 seg)
-> Request -> (Tiempo superior a 15 segundos) (Request)...
Make a request without waiting for the previous promise to be fulfilled, that is the problem.
Sample code:
If you can help me out, it would be very helpful.
Thank you all.