({
animationIn,
animationOut,
}: {
animationIn: Animation | CustomAnimation;
animationOut: Animation | CustomAnimation;
})
| 38 | // User can define custom react-native-animatable animations, see PR #72 |
| 39 | // Utility for creating our own custom react-native-animatable animations |
| 40 | export const buildAnimations = ({ |
| 41 | animationIn, |
| 42 | animationOut, |
| 43 | }: { |
| 44 | animationIn: Animation | CustomAnimation; |
| 45 | animationOut: Animation | CustomAnimation; |
| 46 | }): Animations => { |
| 47 | let updatedAnimationIn: string; |
| 48 | let updatedAnimationOut: string; |
| 49 | |
| 50 | if (isObject(animationIn)) { |
| 51 | const animationName = JSON.stringify(animationIn); |
| 52 | makeAnimation(animationName, animationIn as CustomAnimation); |
| 53 | updatedAnimationIn = animationName; |
| 54 | } else { |
| 55 | updatedAnimationIn = animationIn; |
| 56 | } |
| 57 | |
| 58 | if (isObject(animationOut)) { |
| 59 | const animationName = JSON.stringify(animationOut); |
| 60 | makeAnimation(animationName, animationOut as CustomAnimation); |
| 61 | updatedAnimationOut = animationName; |
| 62 | } else { |
| 63 | updatedAnimationOut = animationOut; |
| 64 | } |
| 65 | |
| 66 | return { |
| 67 | animationIn: updatedAnimationIn, |
| 68 | animationOut: updatedAnimationOut, |
| 69 | }; |
| 70 | }; |
| 71 | |
| 72 | export const reversePercentage = (x: number) => -(x - 1); |
| 73 |
no test coverage detected
searching dependent graphs…