function doKeyDown(event) { switch (event.keyCode) { case 32: /* Space bar was pressed */ if (x == 4) { setInterval(drawAll, 20);
I used angular with electron,
In my case, setInterval returns a Nodejs Timer object. which when I called clearInterval(timerobject) it did not work.
setInterval
clearInterval(timerobject)
I had to get the id first and call to clearInterval
clearInterval(timerobject._id)
I have struggled many hours with this. hope this helps.