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

Function withIncrementalHydration

packages/core/src/hydration/api.ts:345–387  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

343 * Intent to remove in v24.
344 */
345export function withIncrementalHydration(): Provider[] {
346 const providers: Provider[] = [
347 withEventReplay(),
348 {
349 provide: IS_INCREMENTAL_HYDRATION_ENABLED,
350 useValue: true,
351 },
352 {
353 provide: DEHYDRATED_BLOCK_REGISTRY,
354 useFactory: createDehydratedBlockRegistry,
355 },
356 ];
357
358 if (typeof ngServerMode === 'undefined' || !ngServerMode) {
359 providers.push(
360 {
361 provide: INCREMENTAL_HYDRATION_BOOTSTRAP,
362 useFactory: () => ({
363 requested: false,
364 activated: false,
365 injector: inject(Injector),
366 document: inject(DOCUMENT),
367 }),
368 },
369 {
370 provide: APP_BOOTSTRAP_LISTENER,
371 useFactory: () => {
372 const state = inject(INCREMENTAL_HYDRATION_BOOTSTRAP);
373
374 return () => {
375 if (!state.requested) {
376 state.requested = true;
377 runIncrementalHydrationBootstrap(state);
378 }
379 };
380 },
381 multi: true,
382 },
383 );
384 }
385
386 return providers;
387}
388
389/**
390 *

Callers

nothing calls this directly

Calls 4

withEventReplayFunction · 0.90
injectFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected