animation-utils.js (422B)
1 function waitForIterationChange(animation) { 2 var initialIteration = animation.effect.getComputedTiming().currentIteration; 3 return new Promise(resolve => { 4 window.requestAnimationFrame(handleFrame = () => { 5 if (animation.effect.getComputedTiming().currentIteration != 6 initialIteration) { 7 resolve(); 8 } else { 9 window.requestAnimationFrame(handleFrame); 10 } 11 }); 12 }); 13 }