(record: Thenable<T>)
| 28 | |
| 29 | const TIMEOUT = 30000; |
| 30 | function readRecord<T>(record: Thenable<T>): T | null { |
| 31 | if (typeof React.use === 'function') { |
| 32 | try { |
| 33 | // eslint-disable-next-line react-hooks-published/rules-of-hooks |
| 34 | return React.use(record); |
| 35 | } catch (x) { |
| 36 | if (record.status === 'rejected') { |
| 37 | return null; |
| 38 | } |
| 39 | throw x; |
| 40 | } |
| 41 | } |
| 42 | if (record.status === 'fulfilled') { |
| 43 | return record.value; |
| 44 | } else if (record.status === 'rejected') { |
| 45 | return null; |
| 46 | } else { |
| 47 | throw record; |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | type LoadHookNamesFunction = ( |
| 52 | hookLog: HooksTree, |
no outgoing calls
no test coverage detected