-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Tweens should be composable with no side-effects #269
Comments
Thank you! Glad you liked the library and it helped you! Agreeing that the chain method is unwieldly and not clear at all. We've discussed it before, in #176 and #153 (linking for reference). I have no immediate fix for the issue - I'm just acknowledging it. It requires better thought and probably a breaking change (or more). |
Because the chain method was advertised in the user guide as having an effect even when the return value is ignored, this probably cannot be changed safely in the current version. The best thing we could do right now would be to make the user guide more clear about the behavior. It may also help if we fixed the chain/repeat bug, or if we made a Another option would be to make a |
Write bit more code, you made complex tweens. |
@mikebolt I think since the syntax is so terribad it would be just better to either make a 'breaking change' (bumping major version) or to use a better syntax for V2. |
I think we can deprecate 'chain' and add an equivalent 'compose' method with no side-effects. This should be documented better. |
Tween is already getting complicated. Maybe it is better to pursue something like a |
Hi, I want to preface this by saying this library is excellent. I just finished a medium-sized project using tweenjs and I have some feedback.
I found that it was pretty cumbersome to create complex tweens using this library because the chain method is not side-effect free. Here's a pseudocode example:
As you can see, the second approach is more verbose and messy and less straight forward. This isn't a particularly complex tween but you can see how it would grow unwieldy very quickly.
One other note, when you have tween chains producing side-effects it can lead to subtle bugs. Here's an example:
The text was updated successfully, but these errors were encountered: