Run multiple recursive Promises and break when requested
Let’s look at a simple recursive function that expresses our program at a high level let RUNNING = true const main = async (elem, color = Color ()) => RUNNING ? delay (color, FPS) .then (effect (color => setElemColor (elem, color))) .then (color => main (elem, stepColor (color))) : color We’ve done a little wishful … Read more