I have a function `showNavBar(show: boolean)`, and I'd like to toggle it at a certain scroll point: passing true going forward, passing false back. I'd expect to be able to do something like this:
gsap
.timeline({ scrollTrigger: { /* ... */ } }),
.to(".foo", { /* ... */ })
.call(showNavBar, ???); // Insert solution here ...
.to(".bar", { /* ... */ });
I'm sure I could get this working by using the scroll trigger's onUpdate callback and watching self.progress, but that feels like a hack for a pretty common use case.
Is there any one-liner solution? Apologies if I missed it in the docs.