Recovering from an error during a request
Requests to an external service take ages from the perspective of a computer. In human terms, it would be like sending a satellite to Jupiter and waiting for it to come back to Earth. You can't be 100% sure that the travel will ever be complete and how much time will the travel actually take. Networks are notoriously flacky and it's better to come prepared in case our request does not complete successfully.
Â
Getting ready
This recipe is a little complex, but, does not use advanced concepts. You are expected, nonetheless, to be familiar with using Vue.
We will be using Axios for this recipe. You can complete the Sending basic AJAX requests with Axios recipe if you are unsure of what it exactly entails.
How to do it...
You will build a website for ordering pizzas on Mt. Everest. The area has notoriously poor Internet connection, so we may want to retry a couple of times before giving up on our pizza.
This is what our HTML looks like:
<div id="app">...