vec icon indicating copy to clipboard operation
vec copied to clipboard

Class vs individual exports

Open Andarist opened this issue 4 years ago • 1 comments

I know the size of this package ain't big but I wonder... any particular reason behind choosing the class with only static fields? I've seen some of your other packages are using individual exports (for example the @tldraw/svg)

Andarist avatar Nov 02 '21 16:11 Andarist

My main motivation was that a utility class would let me use extremely generic names, like add and mul, which were initially difficult to identify when exported as individual functions. I ended up using import * as Vec throughout my code, which made me think I should just use a class. 🤷‍♂️

steveruizok avatar Nov 24 '21 14:11 steveruizok