Closed pwolaq closed 6 years ago
This is awesome, thank you very much @pwolaq.
I'm happy to merge it but I was wondering how hard it is in you opinion to keep the delay
prop (and avoid a breaking change).
I've implemented the delay
prop, but also encountered some weird behaviour with tests - after I added a new test for delay
prop some of the tests started to fail.
I will try to fix it tommorow.
You are the best, @pwolaq.
It turns out that I had to call jest.clearAllTimers
after each test in order to prevent this weird behaviour. It should be ok now.
🙌
So I finally found some spare time and went a step further and replaced
setTimeout
withrequestAnimationFrame
as previously suggested.I have removed
delay
parameter for now, but it is possible to implement it to throttle updates - please tell me what do you think about it :)