-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
why is Easing a type? #24
Comments
I had it as a type because it essentially defines three abstract methods. I'm open to recommendations for changes. Should it take the 3 methods as constructor parameters? Should it just be POJOs and the method documentation could be moved to the top of the file? |
This is a bizarre pattern you're using here. You have an abstract base type. You instantiate that abstract base type, which is antithetical to the whole notion of "abstract". Then you morph the abstract instances into concrete instances using assignment. And if I were to inspect instances of I'll leave it up to you to decide whether or not to change this. |
I agree it's a bit weird, and I'm happy to change it. What would you recommend instead? |
function Easing( value, derivative, secondDerivative ) {
// @public (read-only)
this.value = value;
this.derivative = derivative;
this.secondDerivative = secondDerivative;
} |
Easing
is currently a collection of static methods and constants. It's constructor does nothing and it has no state:Why is it a type?
The text was updated successfully, but these errors were encountered: