MCPcopy
hub / github.com/angular/angular / setInjectorProfiler

Function setInjectorProfiler

packages/core/src/render3/debug/injector_profiler.ts:234–246  ·  view source on GitHub ↗
(injectorProfiler: InjectorProfiler | null)

Source from the content-addressed store, hash-verified

232 * @returns a cleanup function that, when invoked, removes a given profiler callback.
233 */
234export 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.

Callers 4

enableProfilingFunction · 0.90

Calls 3

throwErrorFunction · 0.90
removeProfilerFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…