set-interval-serial
Wrapper for setInterval function to prevent overlapping execution
Extends setInterval
and prevents the same function to start unless its previous execution is completed. Useful when
running async tasks that can take time, but cannot run in parallel.
const setIntervalSerial = ;const setTimeoutPromise = ; const asyncFunction = async { await ; console;}; // the output will appear every second, although the interval is set to 50ms;