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
  8962b3f5_7552_fd40_f54b_577feeb9a23e["nextTick()"]
  bf792703_842a_50eb_c357_a2c1c61e235e["next-tick.ts"]
  8962b3f5_7552_fd40_f54b_577feeb9a23e -->|defined in| bf792703_842a_50eb_c357_a2c1c61e235e
  09b66670_60c6_d4f1_48f9_8f5538b7633e["handleError()"]
  8962b3f5_7552_fd40_f54b_577feeb9a23e -->|calls| 09b66670_60c6_d4f1_48f9_8f5538b7633e
  7b52f39b_edca_e88a_aac7_58220f505f07["timerFunc()"]
  8962b3f5_7552_fd40_f54b_577feeb9a23e -->|calls| 7b52f39b_edca_e88a_aac7_58220f505f07
  style 8962b3f5_7552_fd40_f54b_577feeb9a23e 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