aninest root / AnimatableEvents
AnimatableEvents
Various ways to attach and detach event listeners to an Animation.
Index
Type Aliases
Type alias | Description |
---|---|
AnimatableListener | Listens to the animation for a specific event. All events aside from update return a dictionary of local values which are currently being animated. |
Variables
Variable | Description |
---|---|
ANIM_TYPES_WITH_VALUE | List of event types which provide the values which the animation is interpolating to (or in the case of end the final values). |
Functions
Function | Description |
---|---|
addLocalListener | Adds a local listener to the animation. You can listen to the events listed in AnimatableEvents. Animation listeners are scoped to only trigger when the current level of the animation is modified. Animation listeners are called in the order in which they were added. |
addRecursiveListener | Adds a recursive start listener to the animation. This listener will trigger on any child modification. Animation listeners are called in the order in which they were added. |
removeLocalListener | Removes a listener from the animation |
removeRecursiveListener | Removes a recursive start listener from the animation |
EventTypes
Type alias, Variable | Description |
---|---|
AnimatableEvents | The collection of events which can be listened to on an animation. Returns undefined |
AnimatableEventsWithValue | Animation Events which return the values which the animation is interpolating to. Only excludes the update event. |
BEFORE_END | Broadcasts right before the animation ends to allow for the animation to be interrupted before it ends. This is useful to create snapping, looping, or bouncing animations without triggering any END events. |
BEFORE_START | Broadcasts before the animation recurses into its children to update their values. Only broadcasted if there is a local change to the animation at the level this event is attached to. |
END | Broadcasts at the end of an interpolation, excluding any interruptions triggered before the animation fully comes to rest, including interruptions created on the BEFORE_END event. |
IMMUTABLE_START | Same as START but by convention no modifyTo calls should be made in any listeners attached to this event. This is useful for extensions which need to know when the animation is starting such as the proxy extension but which don't need to trigger any modifications to any animation states. |
INTERRUPT | Broadcasts when a new target state is set while the animation is not at its resting state yet. This event is useful for reverting any changes made to the animation state before continuing the animation. See the momentum extension for an example of this. |
START | Broadcasts after an animation's target state is set to a new value. |
UPDATE | Broadcasts every time the animation state's time is updated so long as the animation is running. |