MCPcopy Index your code
hub / github.com/angular/angular / callHookInternal

Function callHookInternal

packages/core/src/render3/hooks.ts:286–295  ·  view source on GitHub ↗

* Executes a single lifecycle hook, making sure that: * - it is called in the non-reactive context; * - profiling data are registered.

(directive: any, hook: () => void)

Source from the content-addressed store, hash-verified

284 * - profiling data are registered.
285 */
286function callHookInternal(directive: any, hook: () => void) {
287 profiler(ProfilerEvent.LifecycleHookStart, directive, hook);
288 const prevConsumer = setActiveConsumer(null);
289 try {
290 hook.call(directive);
291 } finally {
292 setActiveConsumer(prevConsumer);
293 profiler(ProfilerEvent.LifecycleHookEnd, directive, hook);
294 }
295}
296
297/**
298 * Execute one hook against the current `LView`.

Callers 1

callHookFunction · 0.85

Calls 2

profilerFunction · 0.90
setActiveConsumerFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…