Home / Function/ whenTransitionEnds() — vue Function Reference

whenTransitionEnds() — vue Function Reference

Architecture documentation for the whenTransitionEnds() function in transition-util.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  e0b7b972_87d1_2608_0aad_7c5f68d209d5["whenTransitionEnds()"]
  09de2133_5913_40ae_d30e_b3f99608f41b["transition-util.ts"]
  e0b7b972_87d1_2608_0aad_7c5f68d209d5 -->|defined in| 09de2133_5913_40ae_d30e_b3f99608f41b
  37071741_ccab_90b6_f6d5_400706dc8ca0["getTransitionInfo()"]
  e0b7b972_87d1_2608_0aad_7c5f68d209d5 -->|calls| 37071741_ccab_90b6_f6d5_400706dc8ca0
  style e0b7b972_87d1_2608_0aad_7c5f68d209d5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/platforms/web/runtime/transition-util.ts lines 92–119

export function whenTransitionEnds(
  el: Element,
  expectedType: string | undefined,
  cb: Function
) {
  const { type, timeout, propCount } = getTransitionInfo(el, expectedType)
  if (!type) return cb()
  const event: string =
    type === TRANSITION ? transitionEndEvent : animationEndEvent
  let ended = 0
  const end = () => {
    el.removeEventListener(event, onEnd)
    cb()
  }
  const onEnd = e => {
    if (e.target === el) {
      if (++ended >= propCount) {
        end()
      }
    }
  }
  setTimeout(() => {
    if (ended < propCount) {
      end()
    }
  }, timeout + 1)
  el.addEventListener(event, onEnd)
}

Domain

Subdomains

Frequently Asked Questions

What does whenTransitionEnds() do?
whenTransitionEnds() is a function in the vue codebase, defined in src/platforms/web/runtime/transition-util.ts.
Where is whenTransitionEnds() defined?
whenTransitionEnds() is defined in src/platforms/web/runtime/transition-util.ts at line 92.
What does whenTransitionEnds() call?
whenTransitionEnds() calls 1 function(s): getTransitionInfo.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free