fserb / canvas2D

Update Canvas 2D API
Other
151 stars 25 forks source link

[Mesh] constructors vs factory functions #46

Open domenic opened 3 months ago

domenic commented 3 months ago

Per https://w3ctag.github.io/design-principles/#constructors, can we make these have constructors, instead of adding factory functions to CanvasRenderingContext2D?

If the constructor needs to take a CanvasRenderingContext2D as an argument to associate with the correct canvas, that's reasonable.

fmalita commented 3 months ago

Thanks Domenic, I think that makes sense.

Interestingly, in the first iteration we were using constructors. I don't recall why we changed that, probably just trying to minimize boilerplate - so if there's a reason to prefer constructors we should definitely revisit.