File tree 1 file changed +5
-7
lines changed
packages/store/src/execution
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -3,18 +3,16 @@ import { InjectionToken, inject } from '@angular/core';
3
3
import { NGXS_OPTIONS } from '../symbols' ;
4
4
5
5
/**
6
- * The injection token is used internally to resolve an instance of the execution
7
- * strategy. It checks whether consumers have provided their own `executionStrategy`
8
- * and also verifies if we are operating in a zone-aware environment.
6
+ * The injection token is used internally to resolve an instance of the execution strategy.
9
7
*/
10
8
export const NGXS_EXECUTION_STRATEGY = new InjectionToken < NgxsExecutionStrategy > (
11
9
typeof ngDevMode !== 'undefined' && ngDevMode ? 'NGXS_EXECUTION_STRATEGY' : '' ,
12
10
{
13
11
providedIn : 'root' ,
14
- factory : ( ) => {
15
- const options = inject ( NGXS_OPTIONS ) ;
16
- return inject ( options . executionStrategy ! ) ;
17
- }
12
+ // Since `executionStrategy` is a `Type<...>`, we should inject it to retrieve an
13
+ // instance. This injection token essentially holds an instance of the
14
+ // execution strategy class.
15
+ factory : ( ) => inject ( inject ( NGXS_OPTIONS ) . executionStrategy )
18
16
}
19
17
) ;
20
18
You can’t perform that action at this time.
0 commit comments