Monadical-SAS / redux-time

∞ High-performance declarative JS animation library for building games, data-viz experiences, and more w/ React, ThreeJS, Inferno, SnabbDOM and others...
https://monadical-sas.github.io/redux-time
MIT License
119 stars 11 forks source link

Automatic reverting to old position #14

Open akoel opened 6 years ago

akoel commented 6 years ago

Love redux-time! I am using it with react-three-renderer and it works very well. However, currently an object automatically reverts to its old position after running the 'Animate' or 'Translate' function. I use 'Become' to set the position after doing the animation. I am not sure if this is best practice.

My suggestion would be to add a boolean option in the object passed into the 'Animate' or 'Translate' function with something like "revert: true/false". On "false" the end_state will be permanent in the Redux store.

pirate commented 6 years ago

The canonical solution is to set the end state with a Become as well, maybe I'll consider adding a flag.

pirate commented 6 years ago

We think adding a flag is actually a great idea, as it's more intuitive than a second Become at the end, so we'll be implementing this at some point. Thanks for the suggestion @akoel!