Skip to content
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

Add support for calling .start() multiple times on animated sequence #26791

Closed
wants to merge 2 commits into from

Conversation

@lbrdar
Copy link

lbrdar commented Oct 9, 2019

Summary

This PR solves #26790

Changelog

[General] [Fixed] - Fix error thrown when sequence animation was started for the second time

Test Plan

I've added a test to cover this case

@facebook-github-bot

This comment has been minimized.

Copy link

facebook-github-bot commented Oct 9, 2019

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@TheSavior

This comment has been minimized.

Copy link
Member

TheSavior commented Oct 9, 2019

What happens if start is called again before the first animation sequence finishes?

@facebook-github-bot

This comment has been minimized.

Copy link

facebook-github-bot commented Oct 10, 2019

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@lbrdar

This comment has been minimized.

Copy link
Author

lbrdar commented Oct 10, 2019

@TheSavior good question. It won't break but the animation won't play properly either.

I don't think other types of animation (e.g. parallel) handle that case. I guess the user should take care of that? What do you expect to happen in that case?

@TheSavior

This comment has been minimized.

Copy link
Member

TheSavior commented Oct 11, 2019

I'm not sure what the "correct" behavior is here, I just wanted to flag it as it seems like a common edge case of being able to call start multiple times.

Can parallel be called multiple times? What happens for parallel? Naively, I'd hope that they'd be consistent with respect to each other.

@cpojer

This comment has been minimized.

Copy link
Contributor

cpojer commented Oct 14, 2019

I was going to bring up the same concern that @eliwhite did. I think it makes more sense to me to throw an error if start is called more than once. What do you think?

@lbrdar

This comment has been minimized.

Copy link
Author

lbrdar commented Oct 25, 2019

@cpojer are you suggesting that RN always throw an error when start() is called again or just if it's called before the previous iteration is complete?

I'd say it makes sense to throw if called while the previous iteration is still running. Otherwise no. Because I don't see a reason to block a user from starting the same animation multiple times.

@cpojer

This comment has been minimized.

Copy link
Contributor

cpojer commented Oct 28, 2019

Yeah I think that makes sense.

@lbrdar

This comment has been minimized.

Copy link
Author

lbrdar commented Dec 18, 2019

@cpojer @TheSavior updated per your request.

Could you help me with failing checks here?

@cpojer

This comment has been minimized.

Copy link
Contributor

cpojer commented Jan 7, 2020

I took an extended break, sorry I didn't get back to your PR earlier. I thought about this some more and do not feel comfortable changing the behavior right now. While I do not know what the original authors intended, I recommend creating new instances for new animations instead of re-using the same ones.

@cpojer cpojer closed this Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.