INNER CODE UNIT · JavaScript

getOutputRange

tomzaku/react-native-shimmer-placeholder · lib/ShimmerPlaceholder.js:4

const getOutputRange = (width, isReversed) =>
  isReversed ? [width, -width] : [-width, width];

class ShimmerPlaceholder extends PureComponent {
  state = {
    beginShimmerPosition: new Animated.Value(-1),
  };
  getAnimated = () => {
    const { delay, duration, isInteraction } = this.props;
    return Animated.loop(
      Animated.timing(this.state.beginShimmerPosition, {
        toValue: 1,
        delay,
        duration,
        useNativeDriver: Platform.OS !== "web",
        isInteraction,
      })
    );

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…