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 SpringUtils.js #40

Merged
merged 21 commits into from Apr 25, 2019
Merged

Add SpringUtils.js #40

merged 21 commits into from Apr 25, 2019

Conversation

osdnk
Copy link
Contributor

@osdnk osdnk commented Jul 17, 2018

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 added SpringUtils object which is a set of methods for easier spring's config manipulations.

@osdnk osdnk closed this Jul 17, 2018
@osdnk osdnk reopened this Jul 17, 2018
Copy link
Member

@kmagiera kmagiera left a 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)

@osdnk
Copy link
Contributor Author

osdnk commented Oct 1, 2018

@kmagiera, Do you remember our offline discussion about this feature?

@jkadamczyk jkadamczyk self-requested a review April 25, 2019 11:40
@osdnk osdnk changed the title Make spring more like Animated with extra config options Add SpringUtils.js Apr 25, 2019
and,
greaterThan,
} from './../base';
import AnimatedValue from './../core/InternalAnimatedValue';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants