Queuing API message from JavaScript (or Angular JS)
<p>I have a mobile application using Cordova with AgularJS that sends a message to an API. I am supporting HTML5 browsers only.</p>

<p>The API call doesn't need to be instant, it can happen after sometime. So, it is fine if the network is down/slow or the API is down, but the important thing is that the call will happen at some stage. No feedback on the client is needed other than the message is received.</p>

<p><strong>Is there any library (pure JavaScript or Angular JS) that does that? Say call the library and the library will queue the message and deliver it at some stage or try again after a set amount of time until the message is delivered?</strong></p>

<p>If there is no ready-made library, then do you have any best practices of how to achieve this?</p>

<p>N.B. If the browser is restarted, the messages should be still in the queue (so memory storage may not be appropriate)</p>