How to use the react-native-redash.contains function in react-native-redash

To help you get started, we’ve selected a few react-native-redash examples, based on popular ways it is used in public projects.

github rainbow-me / rainbow / src / components / value-chart / ValueChart.js View on Github external
>
            <ActivityIndicator />
          </View>
        )}
        <TimespanSelector
          reloadChart={this.reloadChart}
          direction={change > 0}
        />
        <Animated.Code
          exec={block([
            cond(
              or(eq(this.gestureState, ACTIVE), eq(this.gestureState, BEGAN)),
              set(this.shouldSpring, 1)
            ),
            cond(
              contains([FAILED, CANCELLED, END], this.gestureState),
              block([
                set(this.shouldSpring, 0),
                call([], () => {
                  this._text.updateValue(
                    this.state.currentData[this.state.currentData.length - 1]
                      .value
                  );
                }),
              ]),
              onChange(
                this.touchX,
                call([this.touchX], ([x]) => {
                  let curX = 0;
                  if (x < (width / (amountOfPathPoints + 20)) * 10) {
                    curX = 0;
                  } else if (
github wcandillon / can-it-be-done-in-react-native / the-5-min / src / components / TapHandler.tsx View on Github external
export default ({ onPress, children, value }: TapHandlerProps) => {
  const shouldSpring = new Value(0);
  const state = new Value(UNDETERMINED);
  const gestureHandler = onGestureEvent({ state });
  useCode(
    block([
      cond(eq(state, BEGAN), set(shouldSpring, 1)),
      cond(contains([FAILED, CANCELLED], state), set(shouldSpring, 0)),
      onChange(state, cond(eq(state, END), call([], onPress))),
      cond(eq(state, END), [delay(set(shouldSpring, 0), duration)]),
      cond(
        and(eq(shouldSpring, 1), neq(value, 1)),
        set(
          value,
          timing({
            from: value,
            to: 1,
            easing,
            duration
          })
        )
      ),
      cond(
        and(eq(shouldSpring, 0), neq(value, 0)),