Home / Function/ createWatcher() — vue Function Reference

createWatcher() — vue Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  4cdb033a_f511_f759_d9d2_28da362d97b1["createWatcher()"]
  079339bc_f0ce_0fd0_3d1b_26a2dc073616["state.ts"]
  4cdb033a_f511_f759_d9d2_28da362d97b1 -->|defined in| 079339bc_f0ce_0fd0_3d1b_26a2dc073616
  994c6360_e527_7425_c190_6b0b2cacf6cb["initWatch()"]
  994c6360_e527_7425_c190_6b0b2cacf6cb -->|calls| 4cdb033a_f511_f759_d9d2_28da362d97b1
  8821e5be_a66e_607b_6fb4_39002df1a03a["stateMixin()"]
  8821e5be_a66e_607b_6fb4_39002df1a03a -->|calls| 4cdb033a_f511_f759_d9d2_28da362d97b1
  style 4cdb033a_f511_f759_d9d2_28da362d97b1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/instance/state.ts lines 325–339

function createWatcher(
  vm: Component,
  expOrFn: string | (() => any),
  handler: any,
  options?: Object
) {
  if (isPlainObject(handler)) {
    options = handler
    handler = handler.handler
  }
  if (typeof handler === 'string') {
    handler = vm[handler]
  }
  return vm.$watch(expOrFn, handler, options)
}

Domain

Subdomains

Frequently Asked Questions

What does createWatcher() do?
createWatcher() is a function in the vue codebase, defined in src/core/instance/state.ts.
Where is createWatcher() defined?
createWatcher() is defined in src/core/instance/state.ts at line 325.
What calls createWatcher()?
createWatcher() is called by 2 function(s): initWatch, stateMixin.

Analyze Your Own Codebase

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

Try Supermodel Free