loonywizard / js-confetti

JS Confetti library that supports emojis 🦄 🎉 ⚡️
https://loonywizard.github.io/js-confetti/
MIT License
1.13k stars 48 forks source link

clean up shapes every 10 not 100 iterations #39

Closed loonywizard closed 2 years ago

loonywizard commented 2 years ago

now that we are resolving promise when confetti batch is completed #37 (thanks to @grork), I think we should do clean-up more often in order to remove 1-2 seconds delay between shapes disappearing from the screen and the promise resolve

filtering invisible shapes is not so heavy operation compared to drawing shapes, and on the other hand, we reduce the number of draw operations, so I believe the hole library became a little bit more optimized