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

Function maybeVectorAnim

Libraries/Animated/src/AnimatedImplementation.js:1991–2013  ·  view source on GitHub ↗
(
  value: AnimatedValue | AnimatedValueXY,
  config: Object,
  anim: (value: AnimatedValue, config: Object) => CompositeAnimation
)

Source from the content-addressed store, hash-verified

1989};
1990
1991var maybeVectorAnim = function(
1992 value: AnimatedValue | AnimatedValueXY,
1993 config: Object,
1994 anim: (value: AnimatedValue, config: Object) => CompositeAnimation
1995): ?CompositeAnimation {
1996 if (value instanceof AnimatedValueXY) {
1997 var configX = {...config};
1998 var configY = {...config};
1999 for (var key in config) {
2000 var {x, y} = config[key];
2001 if (x !== undefined && y !== undefined) {
2002 configX[key] = x;
2003 configY[key] = y;
2004 }
2005 }
2006 var aX = anim((value: AnimatedValueXY).x, configX);
2007 var aY = anim((value: AnimatedValueXY).y, configY);
2008 // We use `stopTogether: false` here because otherwise tracking will break
2009 // because the second animation will get stopped before it can update.
2010 return parallel([aX, aY], {stopTogether: false});
2011 }
2012 return null;
2013};
2014
2015var spring = function(
2016 value: AnimatedValue | AnimatedValueXY,

Callers 3

springFunction · 0.85
timingFunction · 0.85
decayFunction · 0.85

Calls 1

parallelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…