Skip to content

Commit 3b7162d

Browse files
JeanMecheAndrewKushnir
authored andcommitted
docs: Add mention to ENVIRONMENT_INITIALIZER (#57464)
Explicitly mention that `ENVIRONMENT_INITIALIZER` should not be async. PR Close #57464
1 parent 3bc2867 commit 3b7162d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/core/src/di/initializer_token.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import {InjectionToken} from './injection_token';
1212
* A multi-provider token for initialization functions that will run upon construction of an
1313
* environment injector.
1414
*
15+
* Note: As opposed to the `APP_INITIALIZER` token, the `ENVIRONMENT_INITIALIZER` functions are not awaited,
16+
* hence they should not be `async`.
17+
*
1518
* @publicApi
1619
*/
1720
export const ENVIRONMENT_INITIALIZER = new InjectionToken<ReadonlyArray<() => void>>(

0 commit comments

Comments
 (0)