Auto Retry Network calls - using Javascript 🔥
For a web application, fetching API data is a common task.
But the API calls might fail because of Network problems. Usually we could show a screen for Network Error and ask users to retry.
One approach to handle this is auto retry when network error occurs.
You are asked to create a fetchWithAutoRetry(fetcher, count), which automatically fetch again when error happens, until the maximum count is met.
For the problem here, there is no need to detect network error, you can just retry on all promise rejections.
Solution Link : codesandbox.io/s/upbeat-burne...
#javascript #javascripttutorial #javascriptengineer #javascriptinterview
Пікірлер: 6
Great explanation..Keep up the good work
Nice explanation
Awesome
add await delay(milis)
Great. Just to know . How to nake this logic while upload download zip file. In createWriteStream func
Thanks... You saved my life 🥲🫂