MCPcopy
hub / github.com/angular/angular / add

Method add

packages/core/src/defer/registry.ts:40–52  ·  view source on GitHub ↗
(blockId: string, info: DehydratedDeferBlock)

Source from the content-addressed store, hash-verified

38 private contract: EventContractDetails = inject(JSACTION_EVENT_CONTRACT);
39
40 add(blockId: string, info: DehydratedDeferBlock) {
41 this.registry.set(blockId, info);
42 // It's possible that hydration is queued that's waiting for the
43 // resolution of a lazy loaded route. In this case, we ensure
44 // the callback function is called to continue the hydration process
45 // for the queued block set.
46 if (this.awaitingCallbacks.has(blockId)) {
47 const awaitingCallbacks = this.awaitingCallbacks.get(blockId)!;
48 for (const cb of awaitingCallbacks) {
49 cb();
50 }
51 }
52 }
53
54 get(blockId: string): DehydratedDeferBlock | null {
55 return this.registry.get(blockId) ?? null;

Callers

nothing calls this directly

Calls 4

setMethod · 0.65
hasMethod · 0.65
getMethod · 0.65
cbFunction · 0.50

Tested by

no test coverage detected