Home / File/ array-spread-mutable-iterator.js — react Source File

array-spread-mutable-iterator.js — react Source File

Architecture documentation for array-spread-mutable-iterator.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

/**
 * TODO: object spreads should have conditionally mutate semantics
 *   Found differences in evaluator results
 *   Non-forget (expected):
 *   (kind: ok) [3,1,5,4]
 *   [3,1,5,4]
 *   [4,1,5,4]
 *   Forget:
 *   (kind: ok) [3,1,5,4]
 *   [3,1,5,4]
 *   [4]
 */

function useBar({arg}) {
  'use memo';

  /**
   * Note that mutableIterator is mutated by the later object spread. Therefore,
   * `s.values()` should be memoized within the same block as the object spread.
   * In terms of compiler internals, they should have the same reactive scope.
   */
  const s = new Set([1, 5, 4]);
  const mutableIterator = s.values();

  return [arg, ...mutableIterator];
}

export const FIXTURE_ENTRYPOINT = {
  fn: useBar,
  params: [{arg: 3}],
  sequentialRenders: [{arg: 3}, {arg: 3}, {arg: 4}],
};

Subdomains

Functions

Frequently Asked Questions

What does array-spread-mutable-iterator.js do?
array-spread-mutable-iterator.js is a source file in the react codebase, written in javascript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in array-spread-mutable-iterator.js?
array-spread-mutable-iterator.js defines 1 function(s): useBar.
Where is array-spread-mutable-iterator.js in the architecture?
array-spread-mutable-iterator.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/array-spread-mutable-iterator.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler).

Analyze Your Own Codebase

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

Try Supermodel Free