Pausing an interval works differently from pausing a timeout. Instead of pausing the timer, the callback is disabled. Pausing an interval does not guarantee that after release the time until the next invocation is the remaining time in the period before pausing. For example, when running an interval with a delay of 1000ms, if the interval is paused 500ms into a period, then resumed after 1250ms, the time until next invocation would be 250ms rather than 500ms.
Creates a
setIntervalfunction that works likewindow.setInterval, but subsequent calls clear the previous and cleanup on unmount is handled automatically. Also providespauseIntervalandresumeIntervalfunctions for managing running intervals.