我已经在列表中存储了一些元素,并希望使用这些元素来执行数学运算(<,>,-,+,=),但尝试这样做会出错。
Soive以一维数组记录了每个人一次跑步所花费的时间,并希望比较时间以找出最快和最慢的时间。
animatedCode = () => {
const clock = new Clock()
const state = {
finished: new Value(0),
position: new Value(0),
time: new Value(0),
frameTime: new Value(0),
}
const config = {
duration: new Value(1000),
toValue: new Value(1),
easing: Easing.inOut(Easing.linear),
}
return block([
cond(and(approximates(this.listTranslationX, EXTREMITY), eq(this.isLoading, 0)),
[set(this.isLoading, 1),
call([new Value(-1)], this.onChangeDate),
startClock(clock),
timing(clock, state, config),
cond(state.finished, [
set(this.translationX, 0)
])]
),
cond(and(approximates(this.listTranslationX, -EXTREMITY), eq(this.isLoading, 0)),
[set(this.isLoading, 1),
call([new Value(1)], this.onChangeDate),
startClock(clock),
timing(clock, state, config),
cond(state.finished, [
set(this.translationX, 0)
])]
),
]);
}