Home / Function/ effect() — vue Function Reference

effect() — vue Function Reference

Architecture documentation for the effect() function in effect.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  9cad6239_f942_b8a2_b55d_bd455308e7dc["effect()"]
  eb15026c_5696_e629_0e8f_4bc0a98f7d98["run()"]
  9cad6239_f942_b8a2_b55d_bd455308e7dc -->|calls| eb15026c_5696_e629_0e8f_4bc0a98f7d98
  style 9cad6239_f942_b8a2_b55d_bd455308e7dc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/v3/reactivity/effect.ts lines 11–20

export function effect(fn: () => any, scheduler?: (cb: any) => void) {
  const watcher = new Watcher(currentInstance, fn, noop, {
    sync: true
  })
  if (scheduler) {
    watcher.update = () => {
      scheduler(() => watcher.run())
    }
  }
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does effect() do?
effect() is a function in the vue codebase.
What does effect() call?
effect() calls 1 function(s): run.

Analyze Your Own Codebase

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

Try Supermodel Free