Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
target,
transition
)
// Convert durations from Framer Motion seconds into Popmotion milliseconds
if (isDurationAnimation(opts) && opts.duration) {
opts.duration *= 1000
}
delay *= 1000
// Bind animation opts to animation
let animation = animationFactory(opts)
// Compose delay
if (delay) {
animation = chain(delayAction(delay), animation)
}
return value.start(complete => {
const activeAnimation = animation.start({
update: (v: any) => value.set(v),
complete,
})
return () => activeAnimation.stop()
})
}
const addActionDelay = (delay = 0, transition: Action) =>
chain(delayAction(delay), transition);
var addActionDelay = function (delay$$1, transition) {
if (delay$$1 === void 0) {
delay$$1 = 0;
}
return chain(delay(delay$$1), transition);
};
var animationLookup = /*#__PURE__*/new Map([['tween', tween], ['spring', spring], ['decay', decay], ['keyframes', keyframes], ['physics', physics]]);
return action(({ update, complete }) => {
update(to)
duration ? delay(duration).start({ complete }) : complete()
})
}