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
reactTouches:(NSArray<NSDictionary *> *)reactTouches
changedIndexes:(NSArray<NSNumber *> *)changedIndexes NS_DESIGNATED_INITIALIZER;
changedIndexes:(NSArray<NSNumber *> *)changedIndexes
coalescingKey:(uint16_t)coalescingKey NS_DESIGNATED_INITIALIZER;
@end

View File

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

View File

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