mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Cleanup bridge init, measure native module init time
This commit is contained in:
@@ -186,8 +186,8 @@ static RCTBridge *RCTCurrentBridgeInstance = nil;
|
||||
_bundleURL = bundleURL;
|
||||
_moduleProvider = block;
|
||||
_launchOptions = [launchOptions copy];
|
||||
[self bindKeys];
|
||||
[self setUp];
|
||||
[self bindKeys];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -214,21 +214,18 @@ RCT_NOT_IMPLEMENTED(-init)
|
||||
object:nil];
|
||||
|
||||
#if TARGET_IPHONE_SIMULATOR
|
||||
|
||||
RCTKeyCommands *commands = [RCTKeyCommands sharedInstance];
|
||||
|
||||
// reload in current mode
|
||||
[commands registerKeyCommandWithInput:@"r"
|
||||
modifierFlags:UIKeyModifierCommand
|
||||
action:^(__unused UIKeyCommand *command)
|
||||
{
|
||||
action:^(__unused UIKeyCommand *command) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:RCTReloadNotification
|
||||
object:nil
|
||||
userInfo:nil];
|
||||
}];
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
- (RCTEventDispatcher *)eventDispatcher
|
||||
@@ -260,6 +257,11 @@ RCT_NOT_IMPLEMENTED(-init)
|
||||
return _batchedBridge.loading;
|
||||
}
|
||||
|
||||
- (BOOL)isValid
|
||||
{
|
||||
return _batchedBridge.valid;
|
||||
}
|
||||
|
||||
- (void)invalidate
|
||||
{
|
||||
RCTAssertMainThread();
|
||||
|
||||
Reference in New Issue
Block a user