MCPcopy Create free account
hub / github.com/ptmt/react-native-macos / decay

Function decay

Libraries/Animated/src/AnimatedImplementation.js:2112–2149  ·  view source on GitHub ↗
(
  value: AnimatedValue | AnimatedValueXY,
  config: DecayAnimationConfig,
)

Source from the content-addressed store, hash-verified

2110};
2111
2112var decay = function(
2113 value: AnimatedValue | AnimatedValueXY,
2114 config: DecayAnimationConfig,
2115): CompositeAnimation {
2116 var start = function(
2117 animatedValue: AnimatedValue | AnimatedValueXY,
2118 configuration: DecayAnimationConfig,
2119 callback?: ?EndCallback): void {
2120 callback = _combineCallbacks(callback, configuration);
2121 var singleValue: any = animatedValue;
2122 var singleConfig: any = configuration;
2123 singleValue.stopTracking();
2124 singleValue.animate(new DecayAnimation(singleConfig), callback);
2125 };
2126
2127 return maybeVectorAnim(value, config, decay) || {
2128 start: function(callback?: ?EndCallback): void {
2129 start(value, config, callback);
2130 },
2131
2132 stop: function(): void {
2133 value.stopAnimation();
2134 },
2135
2136 reset: function(): void {
2137 value.resetAnimation();
2138 },
2139
2140 _startNativeLoop: function(iterations?: number): void {
2141 var singleConfig = { ...config, iterations };
2142 start(value, singleConfig);
2143 },
2144
2145 _isUsingNativeDriver: function(): boolean {
2146 return config.useNativeDriver || false;
2147 }
2148 };
2149};
2150
2151var sequence = function(
2152 animations: Array<CompositeAnimation>,

Callers

nothing calls this directly

Calls 4

maybeVectorAnimFunction · 0.85
startFunction · 0.70
stopAnimationMethod · 0.45
resetAnimationMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…