Home / Function/ nextTick() — vue Function Reference

nextTick() — vue Function Reference

Architecture documentation for the nextTick() function in next-tick.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  a701411a_9fc9_8597_c21b_049eea5dbe2a["nextTick()"]
  6a3cc423_2c8d_a3ad_7c16_364ff040a3cb["next-tick.ts"]
  a701411a_9fc9_8597_c21b_049eea5dbe2a -->|defined in| 6a3cc423_2c8d_a3ad_7c16_364ff040a3cb
  4935dbd4_998d_c5cd_41c0_2e16500a201c["handleError()"]
  a701411a_9fc9_8597_c21b_049eea5dbe2a -->|calls| 4935dbd4_998d_c5cd_41c0_2e16500a201c
  9d85c4db_b542_0bac_e7b0_a44cf40fccfa["timerFunc()"]
  a701411a_9fc9_8597_c21b_049eea5dbe2a -->|calls| 9d85c4db_b542_0bac_e7b0_a44cf40fccfa
  style a701411a_9fc9_8597_c21b_049eea5dbe2a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/util/next-tick.ts lines 94–117

export function nextTick(cb?: (...args: any[]) => any, ctx?: object) {
  let _resolve
  callbacks.push(() => {
    if (cb) {
      try {
        cb.call(ctx)
      } catch (e: any) {
        handleError(e, ctx, 'nextTick')
      }
    } else if (_resolve) {
      _resolve(ctx)
    }
  })
  if (!pending) {
    pending = true
    timerFunc()
  }
  // $flow-disable-line
  if (!cb && typeof Promise !== 'undefined') {
    return new Promise(resolve => {
      _resolve = resolve
    })
  }
}

Domain

Subdomains

Frequently Asked Questions

What does nextTick() do?
nextTick() is a function in the vue codebase, defined in src/core/util/next-tick.ts.
Where is nextTick() defined?
nextTick() is defined in src/core/util/next-tick.ts at line 94.
What does nextTick() call?
nextTick() calls 2 function(s): handleError, timerFunc.

Analyze Your Own Codebase

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

Try Supermodel Free