Simplified event registration

Summary:
Our events all follow a common pattern, so there's no good reason why the configuration should be so verbose. This diff eliminates that redundancy, and gives us the freedom to simplify the underlying mechanism in future without further churning the call sites.
This commit is contained in:
Nick Lockwood
2015-08-11 06:37:12 -07:00
parent 2fe1ac2a83
commit 48af214216
25 changed files with 208 additions and 266 deletions

View File

@@ -64,7 +64,7 @@
_eventDispatcher = [[RCTEventDispatcher alloc] init];
((id<RCTBridgeModule>)_eventDispatcher).bridge = _bridge;
_eventName = @"sampleEvent";
_eventName = RCTNormalizeInputEventName(@"sampleEvent");
_body = @{ @"foo": @"bar" };
_testEvent = [[RCTTestEvent alloc] initWithViewTag:nil
eventName:_eventName
@@ -125,7 +125,7 @@
- (void)testDifferentEventTypesDontCoalesce
{
NSString *firstEventName = @"firstEvent";
NSString *firstEventName = RCTNormalizeInputEventName(@"firstEvent");
RCTTestEvent *firstEvent = [[RCTTestEvent alloc] initWithViewTag:nil
eventName:firstEventName
body:_body];