aninest root / Animatable / createAnimation
createAnimation()
ts
function createAnimation<Init>(init, timing): Animation<Init>
Creates an animation info object, automatically inferring type from the init object.
Type Parameters
• Init extends RecursiveAnimatable
<unknown
>
Parameters
• init: Init
The initial state of the animation
• timing: Interp
The timing function. See Interp for some common timing functions.
Returns
Animation
<Init
>
The animation info object.
Example
ts
const anim = createAnimation({ a: 0, b: 0 }, getLinearInterp(1), {
upper: { a: 1, b: 1 },
lower: { a: -1, b: -1 },
})