MCPcopy Index your code
hub / github.com/angular/angular / cleanupParentContainer

Function cleanupParentContainer

packages/core/src/defer/triggering.ts:523–537  ·  view source on GitHub ↗

* Clean up the parent container of a block where content changed between server and client. * The parent of a block going through `triggerHydrationFromBlockName` will contain the * dehydrated content that needs to be cleaned up. So we have to do the clean up from that location * in the tree.

(
  currentBlockIdx: number,
  hydrationQueue: string[],
  dehydratedBlockRegistry: DehydratedBlockRegistry,
)

Source from the content-addressed store, hash-verified

521 * in the tree.
522 */
523function cleanupParentContainer(
524 currentBlockIdx: number,
525 hydrationQueue: string[],
526 dehydratedBlockRegistry: DehydratedBlockRegistry,
527) {
528 // If a parent block exists, it's in the hydration queue in front of the current block.
529 const parentDeferBlockIdx = currentBlockIdx - 1;
530 const parentDeferBlock =
531 parentDeferBlockIdx > -1
532 ? dehydratedBlockRegistry.get(hydrationQueue[parentDeferBlockIdx])
533 : null;
534 if (parentDeferBlock) {
535 cleanupLContainer(parentDeferBlock.lContainer);
536 }
537}
538
539function cleanupRemainingHydrationQueue(
540 hydrationQueue: string[],

Callers 1

Calls 2

cleanupLContainerFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…