Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
seek(newProgress: number) {
elapsed = getValueFromProgress(0, duration, newProgress);
onFrameUpdate(updateTween, true);
return this;
},
reverse() {
const onUpdate = (v) => {
this.current[key] = v;
onFrameUpdate(this.scheduledUpdate);
};
const onUpdate = (v) => {
this.current[i] = v;
onFrameUpdate(this.scheduledUpdate);
};
set(v) {
this.toUpdate = v;
onFrameUpdate(this.scheduledUpdate);
return v;
}
tweenTimer = onFrame().start((i) => {
elapsed += timeSinceLastFrame() * playDirection;
updateTween();
if (isTweenComplete() && complete) {
tweenTimer.stop();
onFrameUpdate(complete, true);
}
});
};
this.prev = this.current;
const { onUpdate, passive } = this.props;
if (this.update) {
this.current = this.update(this.current);
}
if (onUpdate) {
onUpdate(this.get(), this);
}
this.fireListeners();
if (!passive && this._isActive) {
onFrameUpdate(this.scheduledUpdate);
}
if (this.isActionComplete && this.isActionComplete()) {
this.complete();
}
return this;
};
start() {
const { onStart, _onStart, passive } = this.props;
if (!passive) {
this._isActive = true;
onFrameUpdate(this.scheduledUpdate);
}
if (this.onStart) this.onStart();
if (onStart) onStart(this);
if (_onStart) _onStart(this);
return this;
}
const clock = () => action(({ update }) => {
const nextFrame = () => {
update();
onFrameUpdate(nextFrame);
};
onFrameUpdate(nextFrame);
return {
stop: () => cancelOnFrameUpdate(nextFrame)
};
});