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

Function readRecord

packages/react-devtools-timeline/src/timelineCache.js:29–48  ·  view source on GitHub ↗
(record: Thenable<T>)

Source from the content-addressed store, hash-verified

27> = new Map();
28
29function readRecord<T>(record: Thenable<T>): T | Error {
30 if (typeof React.use === 'function') {
31 try {
32 // eslint-disable-next-line react-hooks-published/rules-of-hooks
33 return React.use(record);
34 } catch (x) {
35 if (record.status === 'rejected') {
36 return (record.reason: any);
37 }
38 throw x;
39 }
40 }
41 if (record.status === 'fulfilled') {
42 return record.value;
43 } else if (record.status === 'rejected') {
44 return (record.reason: any);
45 } else {
46 throw record;
47 }
48}
49
50export function importFile(file: File): TimelineData | Error {
51 const fileName = file.name;

Callers 1

importFileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected