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 CoreRuntime Observer calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  f780ff44_85db_e399_d971_8fdf493ab15a["teardown()"]
  e7f4f452_deed_8a48_b501_c415a06a6251["Watcher"]
  f780ff44_85db_e399_d971_8fdf493ab15a -->|defined in| e7f4f452_deed_8a48_b501_c415a06a6251
  c74446fc_5d22_d545_3c00_31643a8c20db["stateMixin()"]
  c74446fc_5d22_d545_3c00_31643a8c20db -->|calls| f780ff44_85db_e399_d971_8fdf493ab15a
  1b10e00d_02e6_305e_b4ad_0e11475c3139["doWatch()"]
  1b10e00d_02e6_305e_b4ad_0e11475c3139 -->|calls| f780ff44_85db_e399_d971_8fdf493ab15a
  6dd1ab57_f5b5_94ab_fab6_34852abb2663["removeSub()"]
  f780ff44_85db_e399_d971_8fdf493ab15a -->|calls| 6dd1ab57_f5b5_94ab_fab6_34852abb2663
  style f780ff44_85db_e399_d971_8fdf493ab15a 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