Home / Class/ Empty Class — react Architecture

Empty Class — react Architecture

Architecture documentation for the Empty class in Stack.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  3b6d4c03_f155_9c20_1f6c_e830f69799a3["Empty"]
  a4f6856b_1fb6_fbaa_dad2_faf7da011133["Stack.ts"]
  3b6d4c03_f155_9c20_1f6c_e830f69799a3 -->|defined in| a4f6856b_1fb6_fbaa_dad2_faf7da011133
  1e630bb6_97fc_d2ab_389a_d5737426d78f["push()"]
  3b6d4c03_f155_9c20_1f6c_e830f69799a3 -->|method| 1e630bb6_97fc_d2ab_389a_d5737426d78f
  ef2dd6bd_20ab_82d1_9032_f03f982eb918["pop()"]
  3b6d4c03_f155_9c20_1f6c_e830f69799a3 -->|method| ef2dd6bd_20ab_82d1_9032_f03f982eb918
  637ab5a6_5123_e897_e245_fce1dcb47f78["find()"]
  3b6d4c03_f155_9c20_1f6c_e830f69799a3 -->|method| 637ab5a6_5123_e897_e245_fce1dcb47f78
  5552422f_cc42_016b_fa16_693afdb44ec2["contains()"]
  3b6d4c03_f155_9c20_1f6c_e830f69799a3 -->|method| 5552422f_cc42_016b_fa16_693afdb44ec2
  217911cd_320e_d2ba_59b5_85486415a27b["each()"]
  3b6d4c03_f155_9c20_1f6c_e830f69799a3 -->|method| 217911cd_320e_d2ba_59b5_85486415a27b
  1ca6b10b_0f8f_40e3_7bbf_ddca97c5ff9c["value()"]
  3b6d4c03_f155_9c20_1f6c_e830f69799a3 -->|method| 1ca6b10b_0f8f_40e3_7bbf_ddca97c5ff9c
  fac18bcb_bd01_0317_d5d5_aec1610dc1c0["print()"]
  3b6d4c03_f155_9c20_1f6c_e830f69799a3 -->|method| fac18bcb_bd01_0317_d5d5_aec1610dc1c0

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/Utils/Stack.ts lines 86–109

class Empty<T> implements StackInterface<T> {
  push(value: T): Stack<T> {
    return new Node(value as T, this as Stack<T>);
  }
  pop(): Stack<T> {
    return this;
  }

  find(_fn: (value: T) => boolean): boolean {
    return false;
  }
  contains(_value: T): boolean {
    return false;
  }
  each(_fn: (value: T) => void): void {
    return;
  }
  get value(): T | null {
    return null;
  }
  print(_: (node: T) => string): string {
    return '';
  }
}

Domain

Frequently Asked Questions

What is the Empty class?
Empty is a class in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/Utils/Stack.ts.
Where is Empty defined?
Empty is defined in compiler/packages/babel-plugin-react-compiler/src/Utils/Stack.ts at line 86.

Analyze Your Own Codebase

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

Try Supermodel Free