Open
Description
In #12119 we resolved to treat AnimationTriggers as "external controllers" of animations rather than an underlying mechanism for how animations play. With this model, we need an explicit way to associate AnimationTriggers with Animations. In #12119 We proposed AnimationTrigger.addAnimation(Animation)
and AnimationTrigger.removeAnimation(animation)
.
I'm filing this issue separately as the main item in #12119 has been resolved on and that issue already has a pretty long thread.
Picking up from @flackr's suggestion, some possible options are:
AnimationTrigger.addAnimation(Animation)
/AnimationTrigger.removeAnimation(animation)
which follows the pattern ofEventTarget.addEventListener
,AnimationTrigger.animations.add
/AnimationTrigger.animations.remove
which follows the pattern ofElement.classList.
My preference would be for AnimationTrigger.addAnimation
/AnimationTrigger.removeAnimation
.