adding coalescing key generation for scroll events

Reviewed By: javache

Differential Revision: D3092857

fb-gh-sync-id: 79a1e235d97d484ee7247f17250759b161bc2c07
fbshipit-source-id: 79a1e235d97d484ee7247f17250759b161bc2c07
This commit is contained in:
Martin Kralik 2016-04-01 06:53:08 -07:00 committed by Facebook Github Bot 8
parent a37075dcec
commit cefc5a66f2
1 changed files with 7 additions and 1 deletions

View File

@ -392,6 +392,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
NSMutableArray<NSValue *> *_cachedChildFrames;
BOOL _allowNextScrollNoMatterWhat;
CGRect _lastClippedToRect;
uint16_t _coalescingKey;
RCTScrollEventType _lastEmittedEventType;
}
@synthesize nativeScrollDelegate = _nativeScrollDelegate;
@ -925,11 +927,15 @@ RCT_SET_AND_PRESERVE_OFFSET(setScrollIndicatorInsets, scrollIndicatorInsets, UIE
scrollView:(UIScrollView *)scrollView
userData:(NSDictionary *)userData
{
if (_lastEmittedEventType != type) {
_coalescingKey++;
_lastEmittedEventType = type;
}
[_eventDispatcher sendScrollEventWithType:type
reactTag:reactTag
scrollView:scrollView
userData:userData
coalescingKey:0];
coalescingKey:_coalescingKey];
}
@end