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
  ddb96146_01d1_fd85_9f00_1f6bdd19831c["createWatcher()"]
  910d3a96_5984_cf85_40a3_47933bd75818["state.ts"]
  ddb96146_01d1_fd85_9f00_1f6bdd19831c -->|defined in| 910d3a96_5984_cf85_40a3_47933bd75818
  4a1391cc_a612_214d_dea9_12046e674c94["initWatch()"]
  4a1391cc_a612_214d_dea9_12046e674c94 -->|calls| ddb96146_01d1_fd85_9f00_1f6bdd19831c
  c74446fc_5d22_d545_3c00_31643a8c20db["stateMixin()"]
  c74446fc_5d22_d545_3c00_31643a8c20db -->|calls| ddb96146_01d1_fd85_9f00_1f6bdd19831c
  style ddb96146_01d1_fd85_9f00_1f6bdd19831c 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