DEV Community


Discussion on: JavaScript mouse drawing on the canvas 👨‍🎨

youpiwaza profile image

Pretty neat. I used to teach a similar exercice.

I'd recommand using lowdash.debounce or throttle to optimize events (limit the drawing, as JS basic event system is consuming hard ^^')

dailydevtips1 profile image
Chris Bongers Author

Good advice, but I wanted to showcase it in plain javascript, without using any packages.
Generally tracking mousemove fulltime is pretty hard yes, for some reason, this doesn't seem to spike CPU much.