(injectorProfiler: InjectorProfiler | null)
| 232 | * @returns a cleanup function that, when invoked, removes a given profiler callback. |
| 233 | */ |
| 234 | export function setInjectorProfiler(injectorProfiler: InjectorProfiler | null): () => void { |
| 235 | !ngDevMode && throwError('setInjectorProfiler should never be called in production mode'); |
| 236 | |
| 237 | if (injectorProfiler !== null) { |
| 238 | if (!injectorProfilerCallbacks.includes(injectorProfiler)) { |
| 239 | injectorProfilerCallbacks.push(injectorProfiler); |
| 240 | } |
| 241 | return () => removeProfiler(injectorProfiler); |
| 242 | } else { |
| 243 | injectorProfilerCallbacks.length = 0; |
| 244 | return NOOP_PROFILER_REMOVAL; |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | /** |
| 249 | * Injector profiler function which emits on DI events executed by the runtime. |
no test coverage detected
searching dependent graphs…