Home / File/ ReactCacheOld.js — react Source File

ReactCacheOld.js — react Source File

Architecture documentation for ReactCacheOld.js, a javascript file in the react codebase. 3 imports, 0 dependents.

File javascript BabelCompiler Validation 3 imports 5 functions

Entity Profile

Dependency Diagram

graph LR
  8ab83c6a_7f7f_de7c_f120_e86a1c481f9e["ReactCacheOld.js"]
  57da4469_3808_3be7_cda2_0920208b9c2a["LRU.js"]
  8ab83c6a_7f7f_de7c_f120_e86a1c481f9e --> 57da4469_3808_3be7_cda2_0920208b9c2a
  d8f20c67_f5fa_0f0a_c967_c41fd9ffce07["ReactTypes"]
  8ab83c6a_7f7f_de7c_f120_e86a1c481f9e --> d8f20c67_f5fa_0f0a_c967_c41fd9ffce07
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  8ab83c6a_7f7f_de7c_f120_e86a1c481f9e --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  style 8ab83c6a_7f7f_de7c_f120_e86a1c481f9e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

import type {ReactContext, Thenable} from 'shared/ReactTypes';

import * as React from 'react';

import {createLRU} from './LRU';

interface Suspender {
  then(resolve: () => mixed, reject: () => mixed): mixed;
}

type PendingResult = {
  status: 0,
  value: Suspender,
};

type ResolvedResult<V> = {
  status: 1,
  value: V,
};

type RejectedResult = {
  status: 2,
  value: mixed,
};

type Result<V> = PendingResult | ResolvedResult<V> | RejectedResult;

type Resource<I, V> = {
  read(I): V,
  preload(I): void,
  ...
};

const Pending = 0;
const Resolved = 1;
const Rejected = 2;

const SharedInternals =
  React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;

function readContext(Context: ReactContext<mixed>) {
  const dispatcher = SharedInternals.H;
  if (dispatcher === null) {
    // This wasn't being minified but we're going to retire this package anyway.
    // eslint-disable-next-line react-internal/prod-error-codes
    throw new Error(
      'react-cache: read and preload may only be called from within a ' +
        "component's render. They are not supported in event handlers or " +
        'lifecycle methods.',
    );
  }
// ... (132 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does ReactCacheOld.js do?
ReactCacheOld.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in ReactCacheOld.js?
ReactCacheOld.js defines 5 function(s): accessResult, deleteEntry, identityHashFn, readContext, unstable_setGlobalCacheLimit.
What does ReactCacheOld.js depend on?
ReactCacheOld.js imports 3 module(s): LRU.js, ReactTypes, react.
Where is ReactCacheOld.js in the architecture?
ReactCacheOld.js is located at packages/react-cache/src/ReactCacheOld.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-cache/src).

Analyze Your Own Codebase

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

Try Supermodel Free