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

Function stringifyState

packages/core/src/render3/util/control_flow.ts:268–283  ·  view source on GitHub ↗

* Turns the `DeferBlockState` into a string which is more readable than the enum form. * * @param lDetails Information about the * @returns

(state: DeferBlockState | DeferBlockInternalState)

Source from the content-addressed store, hash-verified

266 * @returns
267 */
268function stringifyState(state: DeferBlockState | DeferBlockInternalState): DeferBlockData['state'] {
269 switch (state) {
270 case DeferBlockState.Complete:
271 return 'complete';
272 case DeferBlockState.Loading:
273 return 'loading';
274 case DeferBlockState.Placeholder:
275 return 'placeholder';
276 case DeferBlockState.Error:
277 return 'error';
278 case DeferBlockInternalState.Initial:
279 return 'initial';
280 default:
281 throw new Error(`Unrecognized state ${state}`);
282 }
283}
284
285/**
286 * Infers the hydration state of a specific defer block.

Callers 1

deferBlockFinderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…