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

Function defer

packages/compiler/src/template/pipeline/src/instruction.ts:302–338  ·  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

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