Home / Function/ createLifeCycle() — vue Function Reference

createLifeCycle() — vue Function Reference

Architecture documentation for the createLifeCycle() function in apiLifecycle.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  3846238a_0431_54f0_c31b_5f0b47b512bf["createLifeCycle()"]
  8df087fa_469a_a5bf_ab87_3d7db45481ea["apiLifecycle.ts"]
  3846238a_0431_54f0_c31b_5f0b47b512bf -->|defined in| 8df087fa_469a_a5bf_ab87_3d7db45481ea
  f5f95add_5644_8e46_f6ba_e31b18e7bc65["formatName()"]
  3846238a_0431_54f0_c31b_5f0b47b512bf -->|calls| f5f95add_5644_8e46_f6ba_e31b18e7bc65
  6e2efdbe_2ee6_7a34_bf53_b595e6a7d16d["injectHook()"]
  3846238a_0431_54f0_c31b_5f0b47b512bf -->|calls| 6e2efdbe_2ee6_7a34_bf53_b595e6a7d16d
  style 3846238a_0431_54f0_c31b_5f0b47b512bf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/v3/apiLifecycle.ts lines 6–23

function createLifeCycle<T extends (...args: any[]) => any = () => void>(
  hookName: string
) {
  return (fn: T, target: any = currentInstance) => {
    if (!target) {
      __DEV__ &&
        warn(
          `${formatName(
            hookName
          )} is called when there is no active component instance to be ` +
            `associated with. ` +
            `Lifecycle injection APIs can only be used during execution of setup().`
        )
      return
    }
    return injectHook(target, hookName, fn)
  }
}

Domain

Subdomains

Frequently Asked Questions

What does createLifeCycle() do?
createLifeCycle() is a function in the vue codebase, defined in src/v3/apiLifecycle.ts.
Where is createLifeCycle() defined?
createLifeCycle() is defined in src/v3/apiLifecycle.ts at line 6.
What does createLifeCycle() call?
createLifeCycle() calls 2 function(s): formatName, injectHook.

Analyze Your Own Codebase

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

Try Supermodel Free