Performance: Multi-provider pattern
MEDIUM IMPACT
This pattern affects the dependency injection system's initialization and memory usage, impacting initial load and runtime injection speed.
providers: [
{ provide: 'API_URL', useValue: 'https://api1.example.com' },
{ provide: 'API_URL_MULTI', multi: true, useValue: 'https://api2.example.com' },
{ provide: 'API_URL_MULTI', multi: true, useValue: 'https://api3.example.com' }
]providers: [
{ provide: 'API_URL', useValue: 'https://api1.example.com' },
{ provide: 'API_URL', useValue: 'https://api2.example.com' },
{ provide: 'API_URL', useValue: 'https://api3.example.com' }
]| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Multiple single providers for same token | N/A | N/A | N/A | [X] Bad |
| Multi-provider token aggregation | N/A | N/A | N/A | [OK] Good |