/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ let profilerCallback = null; /** * Sets the callback function which will be invoked before and after performing certain actions at * runtime (for example, before and after running change detection). * * Warning: this function is *INTERNAL* and should not be relied upon in application's code. * The contract of the function might be changed in any release and/or the function can be removed * completely. * * @param profiler function provided by the caller or null value to disable profiling. */ export const setProfiler = (profiler) => { profilerCallback = profiler; }; /** * Profiler function which wraps user code executed by the runtime. * * @param event ProfilerEvent corresponding to the execution context * @param instance component instance * @param hookOrListener lifecycle hook function or output listener. The value depends on the * execution context * @returns */ export const profiler = function (event, instance, hookOrListener) { if (profilerCallback != null /* both `null` and `undefined` */) { profilerCallback(event, instance, hookOrListener); } }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZmlsZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NyYy9yZW5kZXIzL3Byb2ZpbGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQWdFSCxJQUFJLGdCQUFnQixHQUFrQixJQUFJLENBQUM7QUFFM0M7Ozs7Ozs7OztHQVNHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sV0FBVyxHQUFHLENBQUMsUUFBdUIsRUFBRSxFQUFFO0lBQ3JELGdCQUFnQixHQUFHLFFBQVEsQ0FBQztBQUM5QixDQUFDLENBQUM7QUFFRjs7Ozs7Ozs7R0FRRztBQUNILE1BQU0sQ0FBQyxNQUFNLFFBQVEsR0FBYSxVQUM5QixLQUFvQixFQUFFLFFBQWlCLEVBQUUsY0FBaUM7SUFDNUUsSUFBSSxnQkFBZ0IsSUFBSSxJQUFJLENBQUMsaUNBQWlDLEVBQUU7UUFDOUQsZ0JBQWdCLENBQUMsS0FBSyxFQUFFLFFBQVEsRUFB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