This approach is quite straightforward but comes with a couple of notable flaws: using callbacks can start to resemble the infamous "callback hell" from early Node.js days.
Each recursive call adds complexity, making it harder to track the flow and pinpoint where things go wrong. The bigger issue is that recursion can make debugging more difficult.
By rewriting the polling in a more linear fashion with async & await, we can improve the readability and manageability of the code.
Polling is a mechanism to check the status of a resource, making repeated requests beforehand to see if a task is complete.
Collection
[
|
...
]