kaboom icon indicating copy to clipboard operation
kaboom copied to clipboard

Loop() function executes immediately and before returning EventCanceller

Open szkuwa opened this issue 3 years ago • 0 comments

Version

master

What browsers are you seeing the problem on?

No response

What happened?

I'm using 2000.2.8 but master has the same code for loop()

Trying to cancel loop immediately using event canceller function causes "x is not a function" if it happens in the first iteration.

What's the expected behavior?

User function should be delayed and called after returning event canceller.

Minimum reproducable code

kaboom()

let cancelLoop 
cancelLoop = loop(365 * 24 * 60, () => {
	cancelLoop()	
})

Live demo

No response

szkuwa avatar Mar 11 '22 11:03 szkuwa