Clean up RCTEventDispatcher code

Reviewed By: majak

Differential Revision: D3175583

fb-gh-sync-id: c751c9dc79edfd9cb6073a2ff5dd743a03334bc4
fbshipit-source-id: c751c9dc79edfd9cb6073a2ff5dd743a03334bc4
This commit is contained in:
Pieter De Baets 2016-04-28 05:47:29 -07:00 committed by Facebook Github Bot 1
parent f6d9a9097f
commit feda8ce2ee
4 changed files with 15 additions and 16 deletions

View File

@ -145,17 +145,6 @@ RCT_EXTERN NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass);
*/
@property (nonatomic, weak, readonly) id<RCTBridgeDelegate> delegate;
/**
* The event dispatcher is a wrapper around -enqueueJSCall:args: that provides a
* higher-level interface for sending UI events such as touches and text input.
*
* NOTE: RCTEventDispatcher is now a bridge module, this is implemented as a
* category but remains declared in the bridge to avoid breaking changes
*
* To be moved.
*/
@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher;
/**
* The launch options that were used to initialize the bridge.
*/

View File

@ -209,11 +209,6 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
return [self.batchedBridge moduleIsInitialized:moduleClass];
}
- (RCTEventDispatcher *)eventDispatcher
{
return [self moduleForClass:[RCTEventDispatcher class]];
}
- (void)reload
{
/**

View File

@ -103,3 +103,9 @@ RCT_EXTERN NSString *RCTNormalizeInputEventName(NSString *eventName);
- (void)sendEvent:(id<RCTEvent>)event;
@end
@interface RCTBridge (RCTEventDispatcher)
- (RCTEventDispatcher *)eventDispatcher;
@end

View File

@ -189,3 +189,12 @@ RCT_EXPORT_MODULE()
}
@end
@implementation RCTBridge (RCTEventDispatcher)
- (RCTEventDispatcher *)eventDispatcher
{
return [self moduleForClass:[RCTEventDispatcher class]];
}
@end