Betterprogramming. Let’s look at the setInterval timer.
It is a commonly used Web API feature. “The setInterval() method, offered on the Window and Worker interfaces, repeatedly calls a function or executes a code snippet, with a fixed time delay between each call. It returns an interval ID which uniquely identifies the interval, so you can remove it later by calling clearInterval(). This method is defined by the WindowOrWorkerGlobalScope mixin.” — MDN Web Docs Let’s create a component that calls a callback function to signal that it is done after x cycles.
This is going to be a long one - grab a ☕️ and dig in...