Documentation / @ripl/charts / transitionIfAny
Function: transitionIfAny() ​
transitionIfAny<
TElement>(renderer,elements,options?):Promise<unknown>
Defined in: charts/src/core/animation.ts:93
Runs a transition over the given elements, resolving immediately when there are none. An empty renderer.transition still starts the animation loop and only settles a frame later, so the guard keeps a render with nothing to animate free.
Type Parameters ​
| Type Parameter | Description |
|---|---|
TElement extends Element<Partial<BaseState>, ElementEventMap> | The element type being transitioned. |
Parameters ​
| Parameter | Type | Description |
|---|---|---|
renderer | Renderer | The renderer running the transition. |
elements | TElement | TElement[] | null | undefined | The element(s) to transition; an empty array, null or undefined is a no-op. |
options? | RendererTransitionOptionsArg<TElement> | Transition options, or a factory resolving them per element. |
Returns ​
Promise<unknown>
A promise settling when the transition completes.