How to use the react-native-redash.delay 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.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

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)),
        set(
          value,
github rodolfovilaca / AnimationsExperiments / src / hooks / index.js View on Github external
const config = {
    toValue: new Value(0),
    ...springConfig,
  };

  return [
    cond(clockRunning(clock), 0, [
      set(state.finished, 0),
      set(state.time, 0),
      set(state.velocity, velocity),
      set(config.toValue, dest),
      set(state.position, value),
      cond(
        greaterThan(duration, 0),
        delay(startClock(clock), delayDuration),
        startClock(clock),
      ),
    ]),
    spring(clock, state, config),
    cond(state.finished, stopClock(clock)),
    state.position,
  ];
}
github rainbow-me / rainbow / src / components / value-chart / ValueChart.js View on Github external
state: state =>
            cond(
              or(eq(state, State.BEGAN), eq(state, State.END)),
              set(this.gestureState, state),
              delay(
                cond(
                  or(
                    neq(state, State.FAILED),
                    neq(this.panGestureState, State.ACTIVE)
                  ),
                  set(this.gestureState, state)
                ),
                100
              )
            ),
          x: x =>