I have an asynchronous function which makes a request, makeRequest(): Promise<string>. Basically, I want to make a way of queuing calls to this function so that requests are only being made one at a time.
async function queueRequest(): Promise<string> {
await ... // some code to make sure all previous requests have already been completed
const result = await makeRequest();
return result;
}
What is the best way to achieve something like this?
Thanks in advance