Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
A.clockRunning(clock),
// do nothing if our clock is already running
0,
// otherwise pre set all the values
[
// If the clock isn't running we reset all the animation params and start the clock
A.set(state.finished, 0),
A.set(state.time, 0),
A.set(state.position, value),
A.set(state.frameTime, 0),
A.set(config.toValue, dest),
A.startClock(clock),
],
),
// we run the step here that is going to update position
A.timing(clock, state, config),
// if the animation is over we stop the clock
A.cond(state.finished, A.block([A.stopClock(clock), onFinish])),
// we made the block return the updated position
A.set(value, state.position),
]);
};
setTimeout(async () => {
Animated.timing(
this.chartsMulti[this.currentInterval],
this._configDown
).start();
Animated.timing(
this.chartsMulti[currentInterval],
this._configUp
).start();
this.currentInterval = currentInterval;
this._text.updateValue(
usableData[currentInterval][usableData[currentInterval].length - 1]
.value
);
await this.setState({
currentData: usableData[currentInterval],
isLoading: false,
});
});
}
startTransition(show, onAnimationEnd) {
Animated.timing(this.transition, {
toValue: show ? 100 : 0,
duration: 600,
easing: Easing.bezier(0.19, 1, 0.22, 1),
useNativeDriver: false,
}).start(onAnimationEnd);
}
useEffect(() => {
Animated.timing(translationY, {
toValue: visible ? 0 : SCREEN_HEIGHT,
duration: 300,
easing: Easing.ease
}).start();
}, [visible]);
clock,
decodePhysicsAnimationState(animation.getState(), retainedInstances),
decodeSpringConfig(animation.getConfig(), retainedInstances)
);
} else if (animationNode.hasDecay()) {
const animation = animationNode.getDecay()!;
const clock = decodeClock(animation.getClock(), retainedInstances);
return Animated.decay(
clock,
decodePhysicsAnimationState(animation.getState(), retainedInstances),
decodeDecayConfig(animation.getConfig(), retainedInstances)
);
} else if (animationNode.hasTiming()) {
const animation = animationNode.getTiming()!;
const clock = decodeClock(animation.getClock(), retainedInstances);
return Animated.timing(
clock,
decodeTimingState(animation.getState(), retainedInstances),
decodeTimingConfig(animation.getConfig(), retainedInstances)
);
}
} else if (node.hasBlock()) {
const values = node.getBlock()!;
return Animated.block(
values
.getValuesList()
.map(x => decodeAdaptable(decoder, x, retainedInstances))
);
} else if (node.hasValue()) {
return decodeValue(decodeNumber, node.getValue(), retainedInstances);
} else if (node.hasConcat() && (decoder.decode("") || decoder.decode(1))) {
const values = node.getConcat()!.getValuesList();
const buildAnimation = (value, toValue) => (
Animated.timing(value, {
duration: 175,
easing: Easing.bezier(0.165, 0.84, 0.44, 1),
isInteraction: false,
toValue,
useNativeDriver: true,
}).start()
);
onBlur = (...props) => {
Animated.timing(this.animation, {
duration: 1,
easing: Easing.linear,
toValue: 0,
}).start();
this.setState({ isFocused: false });
if (this.props.onBlur) this.props.onBlur(...props);
};
setTimeout(async () => {
Animated.timing(
this.chartsMulti[this.currentInterval],
this._configDown
).start();
Animated.timing(
this.chartsMulti[currentInterval],
this._configUp
).start();
this.currentInterval = currentInterval;
this._text.updateValue(
usableData[currentInterval][usableData[currentInterval].length - 1]
.value
);
await this.setState({
currentData: usableData[currentInterval],
isLoading: false,
(clock, finished, position, time, frameTime, toValue, duration) =>
Animated.timing(
clock,
{
finished,
frameTime,
position,
time,
},
{
duration,
easing: Easing.linear,
toValue,
}
)
);