2 ms·
Yeah, I think I agree with the learning. A good middle ground would involve building up some helper functions, so you get something like: let Rectangle = {
by stevage 3y ago
Yeah, I think I agree with the learning. A good middle ground would involve building up some helper functions, so you get something like:
let Rectangle = {
resizeTopLeft(position, size, preserveAspect, dx, dy) {
doLeftHandleThing(...);
doTopHandleThing(...);
// something else too
},
Then you don't lose the ability to quickly override things when there are special cases or requirements change, but you can keep the overall code repetition down a bit.