* Turns the `DeferBlockState` into a string which is more readable than the enum form. * * @param lDetails Information about the * @returns
(state: DeferBlockState | DeferBlockInternalState)
| 266 | * @returns |
| 267 | */ |
| 268 | function 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. |
no outgoing calls
no test coverage detected
searching dependent graphs…