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 CoreInstance VDOM calls 1 called by 3

Entity Profile

Dependency Diagram

graph TD
  3d03878c_4a3a_4d94_b9f5_3c7287192b05["teardown()"]
  35e04ef4_6742_973d_927e_07f7ffc64426["stateMixin()"]
  35e04ef4_6742_973d_927e_07f7ffc64426 -->|calls| 3d03878c_4a3a_4d94_b9f5_3c7287192b05
  b2856354_51ef_6ef1_ec4b_ae2e72186601["doWatch()"]
  b2856354_51ef_6ef1_ec4b_ae2e72186601 -->|calls| 3d03878c_4a3a_4d94_b9f5_3c7287192b05
  1323efd8_8b49_c7fc_a4a9_dcd8aeed5387["stop()"]
  1323efd8_8b49_c7fc_a4a9_dcd8aeed5387 -->|calls| 3d03878c_4a3a_4d94_b9f5_3c7287192b05
  a2557d53_306b_b31d_8451_9b748ce8f04d["removeSub()"]
  3d03878c_4a3a_4d94_b9f5_3c7287192b05 -->|calls| a2557d53_306b_b31d_8451_9b748ce8f04d
  style 3d03878c_4a3a_4d94_b9f5_3c7287192b05 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.
What does teardown() call?
teardown() calls 1 function(s): removeSub.
What calls teardown()?
teardown() is called by 3 function(s): doWatch, stateMixin, stop.

Analyze Your Own Codebase

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

Try Supermodel Free