Is there a lifecycle event that can listen to the completion of each repetition?
Author: zhengpqCreated Jun 21, 2023Updated Jun 21, 2023
popmotion is an efficient tool to help me implement animations,but i find that when i start a repeat animation, i can not find a way to do something when each repeat complete. Here is a example:
// suppose that i want to init style at some point
const styleInit = () => {}
//animation code
animate({
from: 0,
to: 40,
ease: easeOut,
duration: 250,
repeat: Infinity,
repeatDelay: 5000,
onUpdate: (latest) => {},
/**
* I want to init the style, but i find that this will
* not be called when each repeat complete because the animation repeats
*/
onComplete() {
styleInit();
},
});how to solve this problem?
Source: Popmotion/popmotion