Re:Show HN: RandomCoin – A cryptocurrency that changes its p...
by unlog on Thursday February 03, 2022 @07:29AM
(#30191598)
Yes, but you have to code for it. I guess you mean you want to "kill the process" in some way, and that's not possible as far as I know.
One easy way is to add a flag
let working = true;
(function work() {
console.log("running");
if (working) requestAnimationFrame(work);
else console.log("stopped");
})();
Programmatically, you have the function cancelAnimationFrame that you give as parameter what requestAnimationFrame returns. The same as setTimeout and clearTimeout
One easy way is to add a flag
Programmatically, you have the function cancelAnimationFrame that you give as parameter what requestAnimationFrame returns. The same as setTimeout and clearTimeout