The goal is to create a queue to store API requests.
Expected result:
- every time the
Addbutton is pressed, the request should be added to the queue; - once
Syncbutton is pressed, all API requests from the queue should be fired and cleared
Here's what I've tried so far: https://codesandbox.io/s/elated-sky-e23w6?file=/src/App.js
There are a few problems here:
- API calls are not fired;
_storegets cleared every time a new request is added;- sync is not working.
- how can I store API request config?
How can this be solved? Thank you!