consider the following code
whatever.onclick = async () => {
const a = await(await fetch("step-1")).text();
const b = await(await fetch("step-2")).text();
whatever.textContent = a + b;
}
The event listener is asynchronous, so if the user clicks again between step-1
and step-2
, there will be competition. Remote is a third party, so it can"t be controlled.
now there are several possible requirements:
- discard the new request if the previous request has not been completed; or
- if the previous request has not been completed, the new request should be returned with the old request; or
- if the previous request has not been completed, the new request should be queued.
do you have a suitable wheel, or do you have to build it yourself?
feels that this is a very reasonable requirement. Why doesn"t loadsh have
?