I need to call multiple HTTP requests and agregate the responses into one record which I’ll dispatch on one last HTTP request.
The requests are:
upsert customer info
calculate shipping costs
Then bundle those two responses to create a Shopping cart
Normally I would use a Promise.all to be able to run the requests in parallel, but I’m wondering which could be a cancelable/less-colorful way to tackle this scenario.
currently I’m using promises.
I am thinking about trying it using some flags, but then I guess I would have to use a setTimeout to check if all the responses have returned. I wonder if there’s a better way. I’ll post a snippet once I have it ready