Wraps an asynchronous function so that it is executed at most once every
duration_ms milliseconds. Additional calls are queued and processed
sequentially following a strict FIFO (first-come first-served) order.
This is useful when throttling API calls or expensive operations.
awaitlimitedFetch("/endpoint"); // executes immediately awaitlimitedFetch("/endpoint"); // queued and executed ≥500ms later console.log(limitedFetch.wait_count); // number of queued calls
Wraps an asynchronous function so that it is executed at most once every
duration_msmilliseconds. Additional calls are queued and processed sequentially following a strict FIFO (first-come first-served) order.This is useful when throttling API calls or expensive operations.