Skip to content

@aninest/extensions / Update / UpdateLayer

UpdateLayer<Animating>

ts
type UpdateLayer<Animating>: Layer<Animating> & object;

An update layer that can be mounted to an animation. Allows listening to:

  • start - when any child animation starts to be updated,
  • update - when any child animation is updated
  • updateWithDeltaTime - each update frame with the time since the last update
  • afterUpdate - after each update frame
  • childStart - when a child UpdateLayer starts to be updated
  • childEnd - when a child UpdateLayer finishes animating everything, including its children
  • done - when the animation finishes animating everything and pauses the updates

Type declaration

setParent()

ts
setParent: (parentLayer, options?) => unsubscribe;

Parameters

parentLayer: UpdateLayer<UnknownRecursiveAnimatable>

options?: SignalOption

Returns

unsubscribe

subscribe()

Type Parameters

Event extends | "start" | "end" | "update" | "updateWithDeltaTime" | "childStart" | "childEnd" | "done" | "afterUpdate"

Parameters

type: Event

sub: Listener<UpdateLayerType<Event, Animating>>

options?: SignalOption

Returns

unsubscribe

Type Parameters

Animating extends UnknownRecursiveAnimatable

Defined in

../../extensions/src/update.ts:81