refactor(devtools): remove unnecessary async from serializeTransferState

Remove unnecessary `async`/`Promise<void>` from `serializeTransferState` and the
redundant `async () =>` wrapper in `provideAppInitializer` — the function contains
no async operations, so this is a zero behavior change cleanup.
This commit is contained in:
bravesasha
2026-05-21 12:18:45 +00:00
committed by Andrew Scott
parent c39b2a3b18
commit a28604be02
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ export const appConfig: ApplicationConfig = {
useClass: DemoApplicationEnvironment,
},
// We simulate a transfer state created by the server-side rendering.
provideAppInitializer(async () => serializeTransferState()),
provideAppInitializer(() => serializeTransferState()),
provideSettings(),
],
};
+1 -1
View File
@@ -12,7 +12,7 @@ import {APP_ID, DOCUMENT, inject, makeStateKey, TransferState} from '@angular/co
/**
* This function serializes the transfer state into the DOM.
*/
export async function serializeTransferState(): Promise<void> {
export function serializeTransferState(): void {
const doc = inject(DOCUMENT);
const appId = inject(APP_ID);
const transferState = inject(TransferState);