File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
packages/react-native-renderer/src/legacy-events Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -184,8 +184,21 @@ function printTouchBank(): string {
184
184
return printed;
185
185
}
186
186
187
+ let instrumentationCallback : ?( string , TouchEvent ) => void ;
188
+
187
189
const ResponderTouchHistoryStore = {
190
+ /**
191
+ * Registers a listener which can be used to instrument every touch event.
192
+ */
193
+ instrument ( callback : ( string , TouchEvent ) = > void ) : void {
194
+ instrumentationCallback = callback ;
195
+ } ,
196
+
188
197
recordTouchTrack ( topLevelType : string , nativeEvent : TouchEvent ) : void {
198
+ if ( instrumentationCallback != null ) {
199
+ instrumentationCallback ( topLevelType , nativeEvent ) ;
200
+ }
201
+
189
202
if ( isMoveish ( topLevelType ) ) {
190
203
nativeEvent . changedTouches . forEach ( recordTouchMove ) ;
191
204
} else if ( isStartish ( topLevelType ) ) {
You can’t perform that action at this time.
0 commit comments