(resourceType: () => T)
| 16 | import {current as currentOwner} from './ReactCurrentFiber'; |
| 17 | |
| 18 | function getCacheForType<T>(resourceType: () => T): T { |
| 19 | const cache: Cache = readContext(CacheContext); |
| 20 | let cacheForType: T | void = (cache.data.get(resourceType): any); |
| 21 | if (cacheForType === undefined) { |
| 22 | cacheForType = resourceType(); |
| 23 | cache.data.set(resourceType, cacheForType); |
| 24 | } |
| 25 | return cacheForType; |
| 26 | } |
| 27 | |
| 28 | function cacheSignal(): null | AbortSignal { |
| 29 | const cache: Cache = readContext(CacheContext); |