( 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, )
| 300 | } |
| 301 | |
| 302 | export 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 | |
| 340 | export function enableIncrementalHydrationRuntime(sourceSpan: ParseSourceSpan | null): ir.CreateOp { |
| 341 | return call(Identifiers.enableIncrementalHydrationRuntime, [], sourceSpan); |
no test coverage detected