Firstly, I read that GSAP uses raF for animation, hence you don't need to use raF while using it, even on scroll functions?? This seems strange to me, as controlling functions outside of tweens/timelines would be aggressive.
For instance, let say am doing something like below. I am being redundant, isn't this how it should be done? Let's say it was function with more complexity. Before you show me some trick to change Bg color with yoyo and a function inside
I just wrote something about this. A general purpose throttle function can be useful for a lot of things, like making a bunch of ajax requests. However, the problem with a lot throttle functions is that they don't fire the callback at the end of the throttling phase, which can result in the last call being skipped. That can be really bad for like a resize.
In general, using requestAnimationFrame to throttle repeating events like resize, scroll, wheel, keydown, mousemouve, touchmove,