@@ -15,11 +15,7 @@ import {IdentityTracker, NodeArray} from '../identity-tracker';
1515
1616import { getLifeCycleName , Hooks , Profiler } from './shared' ;
1717
18- type ProfilerCallback = (
19- event : ɵProfilerEvent ,
20- instanceOrLView : { } | null ,
21- hookOrListener : any ,
22- ) => void ;
18+ type ProfilerCallback = ( event : ɵProfilerEvent , instanceOrLView : { } | null , eventFn : any ) => void ;
2319
2420/** Implementation of Profiler that utilizes framework APIs fire profiler hooks. */
2521export class NgProfiler extends Profiler {
@@ -29,22 +25,20 @@ export class NgProfiler extends Profiler {
2925
3026 constructor ( config : Partial < Hooks > = { } ) {
3127 super ( config ) ;
32- this . _setProfilerCallback (
33- ( event : ɵProfilerEvent , instanceOrLView : { } | null , hookOrListener : any ) => {
34- if ( this [ event ] === undefined ) {
35- return ;
36- }
37-
38- this [ event ] ( instanceOrLView , hookOrListener ) ;
39- } ,
40- ) ;
28+ this . _setProfilerCallback ( ( event : ɵProfilerEvent , instanceOrLView : { } | null , eventFn : any ) => {
29+ if ( this [ event ] === undefined ) {
30+ return ;
31+ }
32+
33+ this [ event ] ( instanceOrLView , eventFn ) ;
34+ } ) ;
4135 this . _initialize ( ) ;
4236 }
4337
4438 private _initialize ( ) : void {
4539 ngDebugClient ( ) . ɵsetProfiler (
46- ( event : ɵProfilerEvent , instanceOrLView : { } | null = null , hookOrListener : any ) =>
47- this . _callbacks . forEach ( ( cb ) => cb ( event , instanceOrLView , hookOrListener ) ) ,
40+ ( event : ɵProfilerEvent , instanceOrLView : { } | null = null , eventFn : any ) =>
41+ this . _callbacks . forEach ( ( cb ) => cb ( event , instanceOrLView , eventFn ) ) ,
4842 ) ;
4943 }
5044
@@ -74,107 +68,107 @@ export class NgProfiler extends Profiler {
7468 } ) ;
7569 }
7670
77- [ ɵProfilerEvent . BootstrapApplicationStart ] ( _directive : any , _hookOrListener : any ) : void {
71+ [ ɵProfilerEvent . BootstrapApplicationStart ] ( _directive : any , _eventFn : any ) : void {
7872 // todo: implement
7973 return ;
8074 }
8175
82- [ ɵProfilerEvent . BootstrapApplicationEnd ] ( _directive : any , _hookOrListener : any ) : void {
76+ [ ɵProfilerEvent . BootstrapApplicationEnd ] ( _directive : any , _eventFn : any ) : void {
8377 // todo: implement
8478 return ;
8579 }
8680
87- [ ɵProfilerEvent . BootstrapComponentStart ] ( _directive : any , _hookOrListener : any ) : void {
81+ [ ɵProfilerEvent . BootstrapComponentStart ] ( _directive : any , _eventFn : any ) : void {
8882 // todo: implement
8983 return ;
9084 }
9185
92- [ ɵProfilerEvent . BootstrapComponentEnd ] ( _directive : any , _hookOrListener : any ) : void {
86+ [ ɵProfilerEvent . BootstrapComponentEnd ] ( _directive : any , _eventFn : any ) : void {
9387 // todo: implement
9488 return ;
9589 }
9690
97- [ ɵProfilerEvent . ChangeDetectionStart ] ( _directive : any , _hookOrListener : any ) : void {
91+ [ ɵProfilerEvent . ChangeDetectionStart ] ( _directive : any , _eventFn : any ) : void {
9892 // todo: implement
9993 return ;
10094 }
10195
102- [ ɵProfilerEvent . ChangeDetectionEnd ] ( _directive : any , _hookOrListener : any ) : void {
96+ [ ɵProfilerEvent . ChangeDetectionEnd ] ( _directive : any , _eventFn : any ) : void {
10397 // todo: implement
10498 return ;
10599 }
106100
107- [ ɵProfilerEvent . ChangeDetectionSyncStart ] ( _directive : any , _hookOrListener : any ) : void {
101+ [ ɵProfilerEvent . ChangeDetectionSyncStart ] ( _directive : any , _eventFn : any ) : void {
108102 // todo: implement
109103 return ;
110104 }
111105
112- [ ɵProfilerEvent . ChangeDetectionSyncEnd ] ( _directive : any , _hookOrListener : any ) : void {
106+ [ ɵProfilerEvent . ChangeDetectionSyncEnd ] ( _directive : any , _eventFn : any ) : void {
113107 // todo: implement
114108 return ;
115109 }
116110
117- [ ɵProfilerEvent . AfterRenderHooksStart ] ( _directive : any , _hookOrListener : any ) : void {
111+ [ ɵProfilerEvent . AfterRenderHooksStart ] ( _directive : any , _eventFn : any ) : void {
118112 // todo: implement
119113 return ;
120114 }
121115
122- [ ɵProfilerEvent . AfterRenderHooksEnd ] ( _directive : any , _hookOrListener : any ) : void {
116+ [ ɵProfilerEvent . AfterRenderHooksEnd ] ( _directive : any , _eventFn : any ) : void {
123117 // todo: implement
124118 return ;
125119 }
126120
127- [ ɵProfilerEvent . ComponentStart ] ( _directive : any , _hookOrListener : any ) : void {
121+ [ ɵProfilerEvent . ComponentStart ] ( _directive : any , _eventFn : any ) : void {
128122 // todo: implement
129123 return ;
130124 }
131125
132- [ ɵProfilerEvent . ComponentEnd ] ( _directive : any , _hookOrListener : any ) : void {
126+ [ ɵProfilerEvent . ComponentEnd ] ( _directive : any , _eventFn : any ) : void {
133127 // todo: implement
134128 return ;
135129 }
136130
137- [ ɵProfilerEvent . DeferBlockStateStart ] ( _directive : any , _hookOrListener : any ) : void {
131+ [ ɵProfilerEvent . DeferBlockStateStart ] ( _directive : any , _eventFn : any ) : void {
138132 // todo: implement
139133 return ;
140134 }
141135
142- [ ɵProfilerEvent . DeferBlockStateEnd ] ( _directive : any , _hookOrListener : any ) : void {
136+ [ ɵProfilerEvent . DeferBlockStateEnd ] ( _directive : any , _eventFn : any ) : void {
143137 // todo: implement
144138 return ;
145139 }
146140
147- [ ɵProfilerEvent . DynamicComponentStart ] ( _directive : any , _hookOrListener : any ) : void {
141+ [ ɵProfilerEvent . DynamicComponentStart ] ( _directive : any , _eventFn : any ) : void {
148142 // todo: implement
149143 return ;
150144 }
151145
152- [ ɵProfilerEvent . DynamicComponentEnd ] ( _directive : any , _hookOrListener : any ) : void {
146+ [ ɵProfilerEvent . DynamicComponentEnd ] ( _directive : any , _eventFn : any ) : void {
153147 // todo: implement
154148 return ;
155149 }
156150
157- [ ɵProfilerEvent . HostBindingsUpdateStart ] ( _directive : any , _hookOrListener : any ) : void {
151+ [ ɵProfilerEvent . HostBindingsUpdateStart ] ( _directive : any , _eventFn : any ) : void {
158152 // todo: implement
159153 return ;
160154 }
161155
162- [ ɵProfilerEvent . HostBindingsUpdateEnd ] ( _directive : any , _hookOrListener : any ) : void {
156+ [ ɵProfilerEvent . HostBindingsUpdateEnd ] ( _directive : any , _eventFn : any ) : void {
163157 // todo: implement
164158 return ;
165159 }
166160
167- [ ɵProfilerEvent . TemplateCreateStart ] ( _directive : any , _hookOrListener : any ) : void {
161+ [ ɵProfilerEvent . TemplateCreateStart ] ( _directive : any , _eventFn : any ) : void {
168162 // todo: implement
169163 return ;
170164 }
171165
172- [ ɵProfilerEvent . TemplateCreateEnd ] ( _directive : any , _hookOrListener : any ) : void {
166+ [ ɵProfilerEvent . TemplateCreateEnd ] ( _directive : any , _eventFn : any ) : void {
173167 // todo: implement
174168 return ;
175169 }
176170
177- [ ɵProfilerEvent . TemplateUpdateStart ] ( context : any , _hookOrListener : any ) : void {
171+ [ ɵProfilerEvent . TemplateUpdateStart ] ( context : any , _eventFn : any ) : void {
178172 if ( ! this . _inChangeDetection ) {
179173 this . _inChangeDetection = true ;
180174 runOutsideAngular ( ( ) => {
@@ -208,7 +202,7 @@ export class NgProfiler extends Profiler {
208202 ) ;
209203 }
210204
211- [ ɵProfilerEvent . TemplateUpdateEnd ] ( context : any , _hookOrListener : any ) : void {
205+ [ ɵProfilerEvent . TemplateUpdateEnd ] ( context : any , _eventFn : any ) : void {
212206 const position = this . _tracker . getDirectivePosition ( context ) ;
213207 const id = this . _tracker . getDirectiveId ( context ) ;
214208
0 commit comments