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
  ba63994a_f426_3629_e039_acc8d1bcb187["createWatcher()"]
  c179f128_4f00_181f_2fb6_82df876bd8eb["initWatch()"]
  c179f128_4f00_181f_2fb6_82df876bd8eb -->|calls| ba63994a_f426_3629_e039_acc8d1bcb187
  35e04ef4_6742_973d_927e_07f7ffc64426["stateMixin()"]
  35e04ef4_6742_973d_927e_07f7ffc64426 -->|calls| ba63994a_f426_3629_e039_acc8d1bcb187
  style ba63994a_f426_3629_e039_acc8d1bcb187 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.
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