Home / File/ effect.ts — vue Source File

effect.ts — vue Source File

Architecture documentation for effect.ts, a typescript file in the vue codebase. 3 imports, 0 dependents.

File typescript CompilerSFC StyleProcessor 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  f67ee11d_fb58_12ca_57cf_731c59a1b595["effect.ts"]
  08d717e5_b9dd_701c_e7a2_51d83681d28a["currentInstance.ts"]
  f67ee11d_fb58_12ca_57cf_731c59a1b595 --> 08d717e5_b9dd_701c_e7a2_51d83681d28a
  816bcd3b_1a7f_7b21_ab25_7a23681aea66["watcher"]
  f67ee11d_fb58_12ca_57cf_731c59a1b595 --> 816bcd3b_1a7f_7b21_ab25_7a23681aea66
  156bf2e1_8a13_f22d_5437_54f14bcef8fa["util"]
  f67ee11d_fb58_12ca_57cf_731c59a1b595 --> 156bf2e1_8a13_f22d_5437_54f14bcef8fa
  style f67ee11d_fb58_12ca_57cf_731c59a1b595 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Watcher from 'core/observer/watcher'
import { noop } from 'shared/util'
import { currentInstance } from '../currentInstance'

// export type EffectScheduler = (...args: any[]) => any

/**
 * @internal since we are not exposing this in Vue 2, it's used only for
 * internal testing.
 */
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

Functions

Dependencies

Frequently Asked Questions

What does effect.ts do?
effect.ts is a source file in the vue codebase, written in typescript. It belongs to the CompilerSFC domain, StyleProcessor subdomain.
What functions are defined in effect.ts?
effect.ts defines 1 function(s): effect.
What does effect.ts depend on?
effect.ts imports 3 module(s): currentInstance.ts, util, watcher.
Where is effect.ts in the architecture?
effect.ts is located at src/v3/reactivity/effect.ts (domain: CompilerSFC, subdomain: StyleProcessor, directory: src/v3/reactivity).

Analyze Your Own Codebase

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

Try Supermodel Free