I'm building some application that need to be able to run offline, so when it's offline i cache every data post in localstorage, and when the browser detect that it's online, i read that cache and begin pushing all data to the server using HttpClient.
The problem is this push all data asynchronously, making it not always pushing in order of data 0 to N, i wonder if there's some algorithm that wait for the first push to end before continuing to the second push? i don't want to use setTimeout as this is slow, i want to keep it speedy while making it run in order.