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 {
184184 return printed;
185185}
186186
187+ let instrumentationCallback : ?( string , TouchEvent ) => void ;
188+
187189const 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+
188197 recordTouchTrack ( topLevelType : string , nativeEvent : TouchEvent ) : void {
198+ if ( instrumentationCallback != null ) {
199+ instrumentationCallback ( topLevelType , nativeEvent ) ;
200+ }
201+
189202 if ( isMoveish ( topLevelType ) ) {
190203 nativeEvent . changedTouches . forEach ( recordTouchMove ) ;
191204 } else if ( isStartish ( topLevelType ) ) {
You can’t perform that action at this time.
0 commit comments