Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
advance(dt: number, spring: SpringValue) {
let idle = true
let changed = false
const anim = spring.animation!
const parent = isFluidValue(anim.to) && anim.to
const payload = isAnimationValue(parent) && parent.node!.getPayload()
anim.values.forEach((node, i) => {
if (node.done) return
let to: number = payload
? payload[i].lastPosition
: parent
? toArray(parent.get())[i]
: anim.toValues![i]
// Parent springs must finish before their children can.
const canFinish = !payload || payload[i].done
const { config } = anim
// Loose springs never move.