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

  • @lavanyaarumugam4055
    @lavanyaarumugam40553 ай бұрын

    Great explanation..Keep up the good work

  • @sourabhbanka
    @sourabhbanka3 жыл бұрын

    Nice explanation

  • @NEWAGEVINES
    @NEWAGEVINES3 жыл бұрын

    Awesome

  • @S4MBENTZ
    @S4MBENTZ Жыл бұрын

    add await delay(milis)

  • @maheshpote7020
    @maheshpote70202 жыл бұрын

    Great. Just to know . How to nake this logic while upload download zip file. In createWriteStream func

  • @likhitverma9661
    @likhitverma9661 Жыл бұрын

    Thanks... You saved my life 🥲🫂