(provider.tag)
| 3511 | let provider = fiber.return; |
| 3512 | while (provider !== null) { |
| 3513 | switch (provider.tag) { |
| 3514 | case CacheComponent: |
| 3515 | case HostRoot: { |
| 3516 | // Schedule an update on the cache boundary to trigger a refresh. |
| 3517 | const lane = requestUpdateLane(provider); |
| 3518 | const refreshUpdate = createLegacyQueueUpdate(lane); |
| 3519 | const root = enqueueLegacyQueueUpdate(provider, refreshUpdate, lane); |
| 3520 | if (root !== null) { |
| 3521 | startUpdateTimerByLane(lane, 'refresh()', fiber); |
| 3522 | scheduleUpdateOnFiber(root, provider, lane); |
| 3523 | entangleLegacyQueueTransitions(root, provider, lane); |
| 3524 | } |
| 3525 | |
| 3526 | // TODO: If a refresh never commits, the new cache created here must be |
| 3527 | // released. A simple case is start refreshing a cache boundary, but then |
| 3528 | // unmount that boundary before the refresh completes. |
| 3529 | const seededCache = createCache(); |
| 3530 | if (seedKey !== null && seedKey !== undefined && root !== null) { |
| 3531 | if (enableLegacyCache) { |
| 3532 | // Seed the cache with the value passed by the caller. This could be |
| 3533 | // from a server mutation, or it could be a streaming response. |
| 3534 | seededCache.data.set(seedKey, seedValue); |
| 3535 | } else { |
| 3536 | if (__DEV__) { |
| 3537 | console.error( |
| 3538 | 'The seed argument is not enabled outside experimental channels.', |
| 3539 | ); |
| 3540 | } |
| 3541 | } |
| 3542 | } |
| 3543 | |
| 3544 | const payload = { |
| 3545 | cache: seededCache, |
| 3546 | }; |
| 3547 | refreshUpdate.payload = payload; |
| 3548 | return; |
| 3549 | } |
| 3550 | } |
| 3551 | provider = provider.return; |
| 3552 | } |
| 3553 | // TODO: Warn if unmounted? |
nothing calls this directly
no test coverage detected