Jump to content
Search Community

timiyay

Members
  • Posts

    1
  • Joined

  • Last visited

timiyay's Achievements

  1. I'm reading up on gsap.context and wondering if it fits my use case. We have a bunch of JS modules that import gsap from 'gsap' and make animations. My assumption is that, by doing this, all our modules are using GSAP's global timeline. I'd like to decouple this, so each module uses its own timeline. The primary goal is easier cleanup, especially for gsap.delayedCall that may run after a module has been destroyed, causing exceptions. The docs for gsap.context state: So I haven't yet figured out how to combine the two, or whether that's the right course of action. For example, instead of import gsap from 'gsap', we could wrap our modules they're already provided a GSAP reference (would this be a timeline? a context?). The aim would be some simple timeline.killAll() or context.revert() when destroying our modules.
×
×
  • Create New...