Home / Function/ teardown() — vue Function Reference

teardown() — vue Function Reference

Architecture documentation for the teardown() function in watcher.ts from the vue codebase.

Function typescript VueCore Observer calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  be270b49_47e8_8f99_8878_880772c2e703["teardown()"]
  6447431e_6924_8ca8_071d_44b55ba081b1["Watcher"]
  be270b49_47e8_8f99_8878_880772c2e703 -->|defined in| 6447431e_6924_8ca8_071d_44b55ba081b1
  8821e5be_a66e_607b_6fb4_39002df1a03a["stateMixin()"]
  8821e5be_a66e_607b_6fb4_39002df1a03a -->|calls| be270b49_47e8_8f99_8878_880772c2e703
  bfa86000_56fb_9b0f_e681_81fbf55feaec["doWatch()"]
  bfa86000_56fb_9b0f_e681_81fbf55feaec -->|calls| be270b49_47e8_8f99_8878_880772c2e703
  e0646fc5_8798_3487_e9e9_047d883eae08["removeSub()"]
  be270b49_47e8_8f99_8878_880772c2e703 -->|calls| e0646fc5_8798_3487_e9e9_047d883eae08
  style be270b49_47e8_8f99_8878_880772c2e703 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/observer/watcher.ts lines 263–277

  teardown() {
    if (this.vm && !this.vm._isBeingDestroyed) {
      remove(this.vm._scope.effects, this)
    }
    if (this.active) {
      let i = this.deps.length
      while (i--) {
        this.deps[i].removeSub(this)
      }
      this.active = false
      if (this.onStop) {
        this.onStop()
      }
    }
  }

Domain

Subdomains

Calls

Frequently Asked Questions

What does teardown() do?
teardown() is a function in the vue codebase, defined in src/core/observer/watcher.ts.
Where is teardown() defined?
teardown() is defined in src/core/observer/watcher.ts at line 263.
What does teardown() call?
teardown() calls 1 function(s): removeSub.
What calls teardown()?
teardown() is called by 2 function(s): doWatch, stateMixin.

Analyze Your Own Codebase

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

Try Supermodel Free