MCPcopy
hub / github.com/facebook/react / readPreviousThenable

Function readPreviousThenable

packages/react-server/src/ReactFizzThenable.js:134–145  ·  view source on GitHub ↗
(
  thenableState: ThenableState,
  index: number,
)

Source from the content-addressed store, hash-verified

132}
133
134export function readPreviousThenable<T>(
135 thenableState: ThenableState,
136 index: number,
137): void | T {
138 const previous = thenableState[index];
139 if (previous === undefined) {
140 return undefined;
141 } else {
142 // We assume this has been resolved already.
143 return (previous: any).value;
144 }
145}
146
147// This is used to track the actual thenable that suspended so it can be
148// passed to the rest of the Suspense implementation — which, for historical

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected