posva / vue-motion

Easy and natural state transitions
https://posva.net/vue-motion
MIT License
379 stars 16 forks source link

Feature request: disable prop to disable animation at some point #9

Open AlexandreBonaventure opened 6 years ago

AlexandreBonaventure commented 6 years ago

Hi, would be great to have more control on animations...

Or, one option could be add a preset animation instant to disable animation ...

posva commented 6 years ago

do you mean like a pause and resume method or an actual prop to make the values simply go through? If it's the second, what is the use case?

AlexandreBonaventure commented 6 years ago

Yeah, sorry I was looking at your code for making a PR, but let me explain you a little bit more. I would need the second, my use-case is using vue-motion to power some transitions for a carousel (and other ui elements). For the carousel, I need to reset (in a instant fashion) the tweened value at some point to handle looping for instance.

posva commented 6 years ago

mmh, I think the PR should be feasible by using a disable or instant prop that is checked in the animate call and returns prematurely plus setting the actual value