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 SpringUtils.js #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if we only allow a fixed structure to be accepted as a config. This could work if we expose helpers for creating state and config (similar to what we have in start/stop PR).
This should then be used in the following way:
const state = spring.makeState();
const config = spring.makeConfigFromOrigamiTensionAndFriction(0.5, 222);
spring(clock, state, config)
@kmagiera, Do you remember our offline discussion about this feature? |
…improvement # Conflicts: # README.md
and, | ||
greaterThan, | ||
} from './../base'; | ||
import AnimatedValue from './../core/InternalAnimatedValue'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Motivation
https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/animations/SpringAnimation.js#L102
API known form RN core is much more flexible when it comes to being flexible.
We wanted to make using spring animation easier.
Changes
We didn't want to modify existing
spring
object so I have addedSpringUtils
object which is a set of methods for easier spring's config manipulations.