Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (this.children) {
this.children.forEach(this.setChild)
}
if (render && this.renderSubscribers) {
this.renderSubscribers.forEach(this.notifySubscriber)
}
// Update timestamp
const { delta, timestamp } = getFrameData()
if (this.lastUpdated !== timestamp) {
this.timeDelta = delta
this.lastUpdated = timestamp
sync.postRender(this.scheduleVelocityCheck)
}
}
update: (transforms: Coords) => {
applyCoordTransform(el, transforms);
// this helps prevent layout thrashing
sync.postRender(() => recordPositions([el]));
},
complete: cachedResolve,
scheduleVelocityCheck = () => sync.postRender(this.velocityCheck);
update(v: Value) {
super.update(v);
this.prev = this.current;
this.updateCurrent(v);
const { delta, timestamp } = getFrameData();
this.timeDelta = delta;
this.lastUpdated = timestamp;
sync.postRender(this.scheduleVelocityCheck);
}
private scheduleVelocityCheck = () => sync.postRender(this.velocityCheck)