RCTTouchEvent's init takes coalescing key

Reviewed By: javache

Differential Revision: D3092861

fb-gh-sync-id: 69beb58c0a2ca3fe33712a57098c8b7300ad49f4
fbshipit-source-id: 69beb58c0a2ca3fe33712a57098c8b7300ad49f4
This commit is contained in:
Martin Kralik 2016-04-01 06:53:10 -07:00 committed by Facebook Github Bot 8
parent cefc5a66f2
commit 7c2b397b00
3 changed files with 12 additions and 3 deletions

View File

@ -19,5 +19,6 @@
- (instancetype)initWithEventName:(NSString *)eventName - (instancetype)initWithEventName:(NSString *)eventName
reactTouches:(NSArray<NSDictionary *> *)reactTouches reactTouches:(NSArray<NSDictionary *> *)reactTouches
changedIndexes:(NSArray<NSNumber *> *)changedIndexes NS_DESIGNATED_INITIALIZER; changedIndexes:(NSArray<NSNumber *> *)changedIndexes
coalescingKey:(uint16_t)coalescingKey NS_DESIGNATED_INITIALIZER;
@end @end

View File

@ -14,20 +14,22 @@
{ {
NSArray<NSDictionary *> *_reactTouches; NSArray<NSDictionary *> *_reactTouches;
NSArray<NSNumber *> *_changedIndexes; NSArray<NSNumber *> *_changedIndexes;
uint16_t _coalescingKey;
} }
@synthesize eventName = _eventName; @synthesize eventName = _eventName;
@synthesize viewTag = _viewTag; @synthesize viewTag = _viewTag;
@synthesize coalescingKey = _coalescingKey;
- (instancetype)initWithEventName:(NSString *)eventName - (instancetype)initWithEventName:(NSString *)eventName
reactTouches:(NSArray<NSDictionary *> *)reactTouches reactTouches:(NSArray<NSDictionary *> *)reactTouches
changedIndexes:(NSArray<NSNumber *> *)changedIndexes changedIndexes:(NSArray<NSNumber *> *)changedIndexes
coalescingKey:(uint16_t)coalescingKey
{ {
if (self = [super init]) { if (self = [super init]) {
_eventName = eventName; _eventName = eventName;
_reactTouches = reactTouches; _reactTouches = reactTouches;
_changedIndexes = changedIndexes; _changedIndexes = changedIndexes;
_coalescingKey = coalescingKey;
} }
return self; return self;
} }
@ -75,4 +77,9 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
return @[RCTNormalizeInputEventName(_eventName), _reactTouches, _changedIndexes]; return @[RCTNormalizeInputEventName(_eventName), _reactTouches, _changedIndexes];
} }
- (uint16_t)coalescingKey
{
return _coalescingKey;
}
@end @end

View File

@ -199,7 +199,8 @@ typedef NS_ENUM(NSInteger, RCTTouchEventType) {
RCTTouchEvent *event = [[RCTTouchEvent alloc] initWithEventName:eventName RCTTouchEvent *event = [[RCTTouchEvent alloc] initWithEventName:eventName
reactTouches:reactTouches reactTouches:reactTouches
changedIndexes:changedIndexes]; changedIndexes:changedIndexes
coalescingKey:0];
[_eventDispatcher sendEvent:event]; [_eventDispatcher sendEvent:event];
} }