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

Function addDepsToRegistry

packages/core/src/defer/utils.ts:122–135  ·  view source on GitHub ↗
(currentDeps: T | null, newDeps: T)

Source from the content-addressed store, hash-verified

120 * making sure that a dependency doesn't yet exist in the registry.
121 */
122export function addDepsToRegistry<T extends DependencyDef[]>(currentDeps: T | null, newDeps: T): T {
123 if (!currentDeps || currentDeps.length === 0) {
124 return newDeps;
125 }
126
127 const currentDepSet = new Set(currentDeps);
128 for (const dep of newDeps) {
129 currentDepSet.add(dep);
130 }
131
132 // If `currentDeps` is the same length, there were no new deps and can
133 // return the original array.
134 return currentDeps.length === currentDepSet.size ? currentDeps : (Array.from(currentDepSet) as T);
135}
136
137/** Retrieves a TNode that represents main content of a defer block. */
138export function getPrimaryBlockTNode(tView: TView, tDetails: TDeferBlockDetails): TContainerNode {

Callers 1

triggerResourceLoadingFunction · 0.90

Calls 1

addMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…