Home / File/ currentInstance.ts — vue Source File

currentInstance.ts — vue Source File

Architecture documentation for currentInstance.ts, a typescript file in the vue codebase. 1 imports, 9 dependents.

File typescript VueCore Instance 1 imports 9 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  9f3b1774_ebd5_0845_1a85_868e0c1fd480["currentInstance.ts"]
  64c87498_c46a_6944_ab9d_8e45519852a8["component"]
  9f3b1774_ebd5_0845_1a85_868e0c1fd480 --> 64c87498_c46a_6944_ab9d_8e45519852a8
  83b69f04_ff47_67cf_7f1c_542b323e1eb5["apiInject.ts"]
  83b69f04_ff47_67cf_7f1c_542b323e1eb5 --> 9f3b1774_ebd5_0845_1a85_868e0c1fd480
  8df087fa_469a_a5bf_ab87_3d7db45481ea["apiLifecycle.ts"]
  8df087fa_469a_a5bf_ab87_3d7db45481ea --> 9f3b1774_ebd5_0845_1a85_868e0c1fd480
  3a7c7919_1905_22a7_f604_9084d5e5d0df["apiSetup.ts"]
  3a7c7919_1905_22a7_f604_9084d5e5d0df --> 9f3b1774_ebd5_0845_1a85_868e0c1fd480
  e5380f01_49bc_d965_1141_151fb5c6c097["apiWatch.ts"]
  e5380f01_49bc_d965_1141_151fb5c6c097 --> 9f3b1774_ebd5_0845_1a85_868e0c1fd480
  a3090893_4f42_c7c7_044e_3d18b8c33433["h.ts"]
  a3090893_4f42_c7c7_044e_3d18b8c33433 --> 9f3b1774_ebd5_0845_1a85_868e0c1fd480
  49a97e06_4034_4e1d_a0e8_bb7368ceb3af["computed.ts"]
  49a97e06_4034_4e1d_a0e8_bb7368ceb3af --> 9f3b1774_ebd5_0845_1a85_868e0c1fd480
  069f27e9_5ae2_91da_c6c6_a92cd4436f7e["effect.ts"]
  069f27e9_5ae2_91da_c6c6_a92cd4436f7e --> 9f3b1774_ebd5_0845_1a85_868e0c1fd480
  ce58cf4d_cc9f_d666_3b1c_eaab6582679e["useCssModule.ts"]
  ce58cf4d_cc9f_d666_3b1c_eaab6582679e --> 9f3b1774_ebd5_0845_1a85_868e0c1fd480
  9c7497a9_d0ae_4161_5b72_874880676aaa["useCssVars.ts"]
  9c7497a9_d0ae_4161_5b72_874880676aaa --> 9f3b1774_ebd5_0845_1a85_868e0c1fd480
  style 9f3b1774_ebd5_0845_1a85_868e0c1fd480 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { Component } from 'types/component'

export let currentInstance: Component | null = null

/**
 * This is exposed for compatibility with v3 (e.g. some functions in VueUse
 * relies on it). Do not use this internally, just use `currentInstance`.
 *
 * @internal this function needs manual type declaration because it relies
 * on previously manually authored types from Vue 2
 */
export function getCurrentInstance(): { proxy: Component } | null {
  return currentInstance && { proxy: currentInstance }
}

/**
 * @internal
 */
export function setCurrentInstance(vm: Component | null = null) {
  if (!vm) currentInstance && currentInstance._scope.off()
  currentInstance = vm
  vm && vm._scope.on()
}

Domain

Subdomains

Dependencies

  • component

Frequently Asked Questions

What does currentInstance.ts do?
currentInstance.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain, Instance subdomain.
What functions are defined in currentInstance.ts?
currentInstance.ts defines 2 function(s): getCurrentInstance, setCurrentInstance.
What does currentInstance.ts depend on?
currentInstance.ts imports 1 module(s): component.
What files import currentInstance.ts?
currentInstance.ts is imported by 9 file(s): apiInject.ts, apiLifecycle.ts, apiSetup.ts, apiWatch.ts, computed.ts, effect.ts, h.ts, useCssModule.ts, and 1 more.
Where is currentInstance.ts in the architecture?
currentInstance.ts is located at src/v3/currentInstance.ts (domain: VueCore, subdomain: Instance, directory: src/v3).

Analyze Your Own Codebase

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

Try Supermodel Free