run() — vue Function Reference
Architecture documentation for the run() function in watcher.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD df67762e_53ee_05bf_1358_c48dd0fc8f8d["run()"] 9ee171a6_a4b8_25d2_3782_d5fdbe38bfec["flushSchedulerQueue()"] 9ee171a6_a4b8_25d2_3782_d5fdbe38bfec -->|calls| df67762e_53ee_05bf_1358_c48dd0fc8f8d 59e4bdf1_7b9a_0d0a_248e_ef175bec51af["update()"] 59e4bdf1_7b9a_0d0a_248e_ef175bec51af -->|calls| df67762e_53ee_05bf_1358_c48dd0fc8f8d b2856354_51ef_6ef1_ec4b_ae2e72186601["doWatch()"] b2856354_51ef_6ef1_ec4b_ae2e72186601 -->|calls| df67762e_53ee_05bf_1358_c48dd0fc8f8d 34cb2d54_d92c_2969_8771_a1a1263ce743["effect()"] 34cb2d54_d92c_2969_8771_a1a1263ce743 -->|calls| df67762e_53ee_05bf_1358_c48dd0fc8f8d 0ab0a954_29ae_5663_de65_22e22ba6d0b0["mountComponent()"] 0ab0a954_29ae_5663_de65_22e22ba6d0b0 -->|calls| df67762e_53ee_05bf_1358_c48dd0fc8f8d c595e491_455c_5f96_1a90_ed59c627158b["get()"] df67762e_53ee_05bf_1358_c48dd0fc8f8d -->|calls| c595e491_455c_5f96_1a90_ed59c627158b 9a19a0fb_0ac6_c945_8710_f996d49877fb["run()"] df67762e_53ee_05bf_1358_c48dd0fc8f8d -->|calls| 9a19a0fb_0ac6_c945_8710_f996d49877fb style df67762e_53ee_05bf_1358_c48dd0fc8f8d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/core/observer/watcher.ts lines 211–239
run() {
if (this.active) {
const value = this.get()
if (
value !== this.value ||
// Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may
// have mutated.
isObject(value) ||
this.deep
) {
// set new value
const oldValue = this.value
this.value = value
if (this.user) {
const info = `callback for watcher "${this.expression}"`
invokeWithErrorHandling(
this.cb,
this.vm,
[value, oldValue],
this.vm,
info
)
} else {
this.cb.call(this.vm, value, oldValue)
}
}
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does run() do?
run() is a function in the vue codebase.
What does run() call?
run() calls 2 function(s): get, run.
What calls run()?
run() is called by 5 function(s): doWatch, effect, flushSchedulerQueue, mountComponent, update.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free