@resee-movies/utilities - v0.8.0
    Preparing search index...

    Function waitForAnimationEnd

    • A utility method that returns a promise which is resolved the next time that the "animationend" or "transitionend" event is emitted from the provided target element. This makes it easy to string together multiple animations in sequence:

      Parameters

      • target: HTMLElement
      • fallbackTimeout: number = 500

      Returns Promise<void>

      async function closeModal() {
      dialogElement.classList.add('collapse');

      await waitForAnimationEnd(dialogElement);

      dialogElement.classList.remove('collapse');
      dialogElement.classList.add('fade-out');

      await waitForAnimationEnd(dialogElement);

      modalClosed();
      }