I'm trying to reset a tween with .invalidate() however when I attempt to use it, after the initial animation, it triggers my 'onComplete' function infinitely and eventually locks up my browser. The docs don't give any examples of how to use this function (http://greensock.com/docs/#/HTML5/GSAP/TweenMax/invalidate/) and other forum posts link to codepens that don't work. My code -
var myTween = TweenMax.to(icon, time, {
rotation: `60`,
transformOrigin: "50% 50%",
ease: ease,
onComplete: function(){
console.log('complete');
myTween.invalidate();
}
});