( injector: Injector, animationFns: VoidFunction | VoidFunction[], animationData?: AnimationLViewData, )
| 38 | ); |
| 39 | |
| 40 | export function addToAnimationQueue( |
| 41 | injector: Injector, |
| 42 | animationFns: VoidFunction | VoidFunction[], |
| 43 | animationData?: AnimationLViewData, |
| 44 | ) { |
| 45 | const animationQueue = injector.get(ANIMATION_QUEUE); |
| 46 | if (Array.isArray(animationFns)) { |
| 47 | for (const animateFn of animationFns) { |
| 48 | animationQueue.queue.add(animateFn); |
| 49 | // If a node is detached, we need to keep track of the queued animation functions |
| 50 | // so we can later remove them from the global animation queue if the view |
| 51 | // is re-attached before the animation queue runs. |
| 52 | animationData?.detachedLeaveAnimationFns?.push(animateFn); |
| 53 | } |
| 54 | } else { |
| 55 | animationQueue.queue.add(animationFns); |
| 56 | // If a node is detached, we need to keep track of the queued animation functions |
| 57 | // so we can later remove them from the global animation queue if the view |
| 58 | // is re-attached before the animation queue runs. |
| 59 | animationData?.detachedLeaveAnimationFns?.push(animationFns); |
| 60 | } |
| 61 | animationQueue.scheduler && animationQueue.scheduler(injector); |
| 62 | } |
| 63 | |
| 64 | export function removeAnimationsFromQueue( |
| 65 | injector: Injector, |
no test coverage detected
searching dependent graphs…