MCPcopy Create free account
hub / github.com/angular/angular / defer

Function defer

packages/compiler/src/template/pipeline/src/instruction.ts:306–342  ·  view source on GitHub ↗
(
  selfSlot: number,
  primarySlot: number,
  dependencyResolverFn: o.Expression | null,
  loadingSlot: number | null,
  placeholderSlot: number | null,
  errorSlot: number | null,
  loadingConfig: o.Expression | null,
  placeholderConfig: o.Expression | null,
  enableTimerScheduling: boolean,
  sourceSpan: ParseSourceSpan | null,
  flags: ir.TDeferDetailsFlags | null,
)

Source from the content-addressed store, hash-verified

304}
305
306export function defer(
307 selfSlot: number,
308 primarySlot: number,
309 dependencyResolverFn: o.Expression | null,
310 loadingSlot: number | null,
311 placeholderSlot: number | null,
312 errorSlot: number | null,
313 loadingConfig: o.Expression | null,
314 placeholderConfig: o.Expression | null,
315 enableTimerScheduling: boolean,
316 sourceSpan: ParseSourceSpan | null,
317 flags: ir.TDeferDetailsFlags | null,
318): ir.CreateOp {
319 const args: Array<o.Expression> = [
320 o.literal(selfSlot),
321 o.literal(primarySlot),
322 dependencyResolverFn ?? o.literal(null),
323 o.literal(loadingSlot),
324 o.literal(placeholderSlot),
325 o.literal(errorSlot),
326 loadingConfig ?? o.literal(null),
327 placeholderConfig ?? o.literal(null),
328 enableTimerScheduling ? o.importExpr(Identifiers.deferEnableTimerScheduling) : o.literal(null),
329 o.literal(flags),
330 ];
331
332 let expr: o.Expression;
333 while (
334 (expr = args[args.length - 1]) !== null &&
335 expr instanceof o.LiteralExpr &&
336 expr.value === null
337 ) {
338 args.pop();
339 }
340
341 return call(Identifiers.defer, args, sourceSpan);
342}
343
344export function enableIncrementalHydrationRuntime(sourceSpan: ParseSourceSpan | null): ir.CreateOp {
345 return call(Identifiers.enableIncrementalHydrationRuntime, [], sourceSpan);

Callers 4

runCanActivateFunction · 0.85
runCanActivateChildFunction · 0.85
runResolveFunction · 0.85
rxjs.defer.spec.tsFile · 0.85

Calls 2

callFunction · 0.85
popMethod · 0.80

Tested by

no test coverage detected