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
  34cb2d54_d92c_2969_8771_a1a1263ce743["effect()"]
  df67762e_53ee_05bf_1358_c48dd0fc8f8d["run()"]
  34cb2d54_d92c_2969_8771_a1a1263ce743 -->|calls| df67762e_53ee_05bf_1358_c48dd0fc8f8d
  style 34cb2d54_d92c_2969_8771_a1a1263ce743 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