Skip to content

aninest root / Animatable / createParentAnimation

createParentAnimation()

ts
function createParentAnimation<Animating>(children, timing): Animation<Animating>

Creates a parent animation from a dictionary of children which will function the same as though the parent and children were created at once.

Type Parameters

Animating extends RecursiveAnimatable<unknown>

Parameters

children: ParentAnimatable<Animating>

a dictionary of children animations and numbers. Note that Animatable objects are not allowed.

timing: Interp

The timing function which will only be applied to the numbers in the provided children dictionary.

Returns

Animation<Animating>

Example

ts
const a = createAnimation({x: 0, y: 0})
const b = createAnimation({x: 1, y: 0})
const anim = createParentAnimation({a, b, c: 1})

Defined in

Animate/Animatable.ts:173